.benchmarks

git-svn-id: svn://ultimatepp.org/upp/trunk@13352 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2019-06-05 17:17:02 +00:00
parent ecb167884d
commit 9b2310bde5
9 changed files with 193 additions and 2 deletions

View file

@ -0,0 +1,46 @@
#include <Core/Core.h>
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<int>));
Vector<Index<int> > 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<int> 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<int> UnlinkKey: " << ts);
ts.Reset();
const int jsize = v_num;
for (int j = 0; j < jsize; ++j) {
v[j].Sweep();
v[j].Shrink();
}
RLOG("Index<int> Sweep: " << ts);
RDUMP(MemoryUsedKb());
RLOG(MemoryProfile());
}

View file

@ -0,0 +1,9 @@
uses
Core;
file
IndexMem.cpp;
mainconfig
"" = "";

View file

@ -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++)

View file

@ -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

View file

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

View file

@ -0,0 +1,12 @@
description "Testing realloc\377";
uses
Core;
file
StringBig.cpp;
mainconfig
"" = "",
"" = "NOREALLOC";

View file

@ -2,7 +2,7 @@ uses
Core;
file
Vector.cpp optimize_speed;
Vector.cpp;
mainconfig
"" = "";

View file

@ -0,0 +1,19 @@
#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
for(int i = 0; i < 10; i++) {
Vector<int> h;
{
RTIMING("Add");
for(int q = 0; q < 40000000; q++)
h.Add(q);
}
{
RTIMING("Shrink");
h.Shrink();
}
}
}

View file

@ -0,0 +1,9 @@
uses
Core;
file
VectorBig.cpp;
mainconfig
"" = "";