diff --git a/benchmarks/IndexMem/IndexMem.cpp b/benchmarks/IndexMem/IndexMem.cpp new file mode 100644 index 000000000..fd00f7724 --- /dev/null +++ b/benchmarks/IndexMem/IndexMem.cpp @@ -0,0 +1,46 @@ +#include + +using namespace Upp; + +CONSOLE_APP_MAIN +{ + StdLogSetup(LOG_COUT|LOG_FILE); + +#ifdef _DEBUG + const int v_num = 10000; +#else + const int v_num = 1000000; +#endif + + RDUMP(sizeof(Index)); + + Vector > v; + v.SetCount(v_num); + RDUMP(MemoryUsedKb()); + const int isize = 100; + TimeStop ts; + for (int i = 0; i < isize; ++i) { + const int jsize = v_num; + for (int j = 0; j < jsize; ++j) + v[j].FindAdd(i); + } + RLOG("Index FindAdd: " << ts); + RDUMP(MemoryUsedKb()); + RLOG(MemoryProfile()); + ts.Reset(); + for (int i = 0; i < isize; ++i) { + const int jsize = v_num; + for (int j = 0; j < jsize; ++j) + v[j].UnlinkKey(i); + } + RLOG("Index UnlinkKey: " << ts); + ts.Reset(); + const int jsize = v_num; + for (int j = 0; j < jsize; ++j) { + v[j].Sweep(); + v[j].Shrink(); + } + RLOG("Index Sweep: " << ts); + RDUMP(MemoryUsedKb()); + RLOG(MemoryProfile()); +} diff --git a/benchmarks/IndexMem/IndexMem.upp b/benchmarks/IndexMem/IndexMem.upp new file mode 100644 index 000000000..44d9f444a --- /dev/null +++ b/benchmarks/IndexMem/IndexMem.upp @@ -0,0 +1,9 @@ +uses + Core; + +file + IndexMem.cpp; + +mainconfig + "" = ""; + diff --git a/benchmarks/SimpleAlloc/SimpleAlloc.cpp b/benchmarks/SimpleAlloc/SimpleAlloc.cpp index a619deeb9..39210229f 100644 --- a/benchmarks/SimpleAlloc/SimpleAlloc.cpp +++ b/benchmarks/SimpleAlloc/SimpleAlloc.cpp @@ -57,7 +57,7 @@ void Consumer() CONSOLE_APP_MAIN { StdLogSetup(LOG_COUT|LOG_FILE); -#if 0 +#if 1 if(1) { for(auto m : { 50, 200, 500, 5000 }) { for(int i = 0; i < NMIX; i++) diff --git a/benchmarks/SimpleAlloc/info.txt b/benchmarks/SimpleAlloc/info.txt index 160cf1202..f3257e2a0 100644 --- a/benchmarks/SimpleAlloc/info.txt +++ b/benchmarks/SimpleAlloc/info.txt @@ -1,3 +1,71 @@ +MINGW +TLS fix + +1 threads Mix 50: 0.766 +2 threads Mix 50: 0.781 +3 threads Mix 50: 0.766 +4 threads Mix 50: 0.813 +8 threads Mix 50: 0.922 +16 threads Mix 50: 1.421 +1 threads Mix 200: 0.765 +2 threads Mix 200: 0.813 +3 threads Mix 200: 0.797 +4 threads Mix 200: 0.812 +8 threads Mix 200: 0.875 +16 threads Mix 200: 1.453 +1 threads Mix 500: 1.140 +2 threads Mix 500: 1.188 +3 threads Mix 500: 1.187 +4 threads Mix 500: 1.219 +8 threads Mix 500: 1.469 +16 threads Mix 500: 1.781 +1 threads Mix 5000: 3.219 +2 threads Mix 5000: 3.281 +3 threads Mix 5000: 3.500 +4 threads Mix 5000: 3.531 +8 threads Mix 5000: 3.781 +16 threads Mix 5000: 5.266 +Pass0 1.734 +sum = 100000000 +Pass 53.219 +sum = 450000000 +count = 100000000 +MemoryUsedKb() = 1602968 +max_count = 22629 + +MINGW -TLS fix +1 threads Mix 50: 2.485 +2 threads Mix 50: 2.515 +3 threads Mix 50: 2.500 +4 threads Mix 50: 2.547 +8 threads Mix 50: 2.594 +16 threads Mix 50: 4.203 +1 threads Mix 200: 2.469 +2 threads Mix 200: 2.500 +3 threads Mix 200: 2.516 +4 threads Mix 200: 2.562 +8 threads Mix 200: 2.625 +16 threads Mix 200: 4.297 +1 threads Mix 500: 2.844 +2 threads Mix 500: 2.875 +3 threads Mix 500: 2.859 +4 threads Mix 500: 2.906 +8 threads Mix 500: 3.016 +16 threads Mix 500: 4.859 +1 threads Mix 5000: 4.828 +2 threads Mix 5000: 4.906 +3 threads Mix 5000: 5.125 +4 threads Mix 5000: 5.110 +8 threads Mix 5000: 5.531 +16 threads Mix 5000: 8.828 +Pass0 4.500 +sum = 100000000 +Pass 63.297 +sum = 450000000 +count = 100000000 +MemoryUsedKb() = 1609880 +max_count = 181505 + + ===== alloc2 Alloc 1.109 diff --git a/benchmarks/StringBig/StringBig.cpp b/benchmarks/StringBig/StringBig.cpp new file mode 100644 index 000000000..134fa5522 --- /dev/null +++ b/benchmarks/StringBig/StringBig.cpp @@ -0,0 +1,28 @@ +#include + +using namespace Upp; + +CONSOLE_APP_MAIN +{ + String text = "0123456789"; + for(int i = 0; i < 10; i++) { + StringBuffer h; + { + RTIMING("Cat"); + for(int i = 0; i < 10000000; i++) + h.Cat(text); + } + RTIMING("Shrink"); + h.Shrink(); + } + return; + + for(int i = 0; i < 10; i++) { + StringStream h; + { + RTIMING("Put"); + for(int i = 0; i < 200000000; i++) + h.Put('a'); + } + } +} diff --git a/benchmarks/StringBig/StringBig.upp b/benchmarks/StringBig/StringBig.upp new file mode 100644 index 000000000..6cc39fed6 --- /dev/null +++ b/benchmarks/StringBig/StringBig.upp @@ -0,0 +1,12 @@ +description "Testing realloc\377"; + +uses + Core; + +file + StringBig.cpp; + +mainconfig + "" = "", + "" = "NOREALLOC"; + diff --git a/benchmarks/Vector/Vector.upp b/benchmarks/Vector/Vector.upp index c64ea2336..f6f1cab93 100644 --- a/benchmarks/Vector/Vector.upp +++ b/benchmarks/Vector/Vector.upp @@ -2,7 +2,7 @@ uses Core; file - Vector.cpp optimize_speed; + Vector.cpp; mainconfig "" = ""; diff --git a/benchmarks/VectorBig/VectorBig.cpp b/benchmarks/VectorBig/VectorBig.cpp new file mode 100644 index 000000000..96ab7310e --- /dev/null +++ b/benchmarks/VectorBig/VectorBig.cpp @@ -0,0 +1,19 @@ +#include + +using namespace Upp; + +CONSOLE_APP_MAIN +{ + for(int i = 0; i < 10; i++) { + Vector h; + { + RTIMING("Add"); + for(int q = 0; q < 40000000; q++) + h.Add(q); + } + { + RTIMING("Shrink"); + h.Shrink(); + } + } +} diff --git a/benchmarks/VectorBig/VectorBig.upp b/benchmarks/VectorBig/VectorBig.upp new file mode 100644 index 000000000..76798eef7 --- /dev/null +++ b/benchmarks/VectorBig/VectorBig.upp @@ -0,0 +1,9 @@ +uses + Core; + +file + VectorBig.cpp; + +mainconfig + "" = ""; +