diff --git a/benchmarks/SimpleAlloc/SimpleAlloc.cpp b/benchmarks/SimpleAlloc/SimpleAlloc.cpp new file mode 100644 index 000000000..cd5d7906a --- /dev/null +++ b/benchmarks/SimpleAlloc/SimpleAlloc.cpp @@ -0,0 +1,23 @@ +#include + +using namespace Upp; + +#define N 20000000 + +void *ptr[N]; + +CONSOLE_APP_MAIN +{ + { + TimeStop tm; + for(int i = 0; i < N; i++) + ptr[i] = new byte[32]; + RLOG("Alloc " << tm); + } + { + TimeStop tm; + for(int i = 0; i < N; i++) + delete[] ptr[i]; + RLOG("Free " << tm); + } +} diff --git a/benchmarks/SimpleAlloc/SimpleAlloc.upp b/benchmarks/SimpleAlloc/SimpleAlloc.upp new file mode 100644 index 000000000..39575f31a --- /dev/null +++ b/benchmarks/SimpleAlloc/SimpleAlloc.upp @@ -0,0 +1,12 @@ +description "Test growth speed of allocator\377"; + +uses + Core; + +file + SimpleAlloc.cpp; + +mainconfig + "" = "", + "" = "USEMALLOC"; + diff --git a/benchmarks/SimpleAlloc/init b/benchmarks/SimpleAlloc/init new file mode 100644 index 000000000..05f7d9397 --- /dev/null +++ b/benchmarks/SimpleAlloc/init @@ -0,0 +1,4 @@ +#ifndef _SimpleAlloc_icpp_init_stub +#define _SimpleAlloc_icpp_init_stub +#include "Core/init" +#endif diff --git a/benchmarks/idmapBench/main.cpp b/benchmarks/idmapBench/main.cpp index 27a06ddf9..89808e757 100644 --- a/benchmarks/idmapBench/main.cpp +++ b/benchmarks/idmapBench/main.cpp @@ -103,6 +103,10 @@ void BenchNTL(const char *file) { PrintMemoryTest("VectorMap"); +#ifdef flagMEMORYTEST + RLOG(order.GetCount()); +#endif + #ifndef NO_OUTPUT for(int i = 0; i < order.GetCount(); i++) { std::cout << ~map.GetKey(order[i]) << ": ";