.benchmarks

git-svn-id: svn://ultimatepp.org/upp/trunk@9314 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-12-21 18:42:39 +00:00
parent 994b9dacaf
commit d72839ce03
4 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1,23 @@
#include <Core/Core.h>
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);
}
}

View file

@ -0,0 +1,12 @@
description "Test growth speed of allocator\377";
uses
Core;
file
SimpleAlloc.cpp;
mainconfig
"" = "",
"" = "USEMALLOC";

View file

@ -0,0 +1,4 @@
#ifndef _SimpleAlloc_icpp_init_stub
#define _SimpleAlloc_icpp_init_stub
#include "Core/init"
#endif

View file

@ -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]) << ": ";