.benchmarks

git-svn-id: svn://ultimatepp.org/upp/trunk@9404 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2016-01-16 14:27:11 +00:00
parent 2480852657
commit b142be778f
3 changed files with 29 additions and 6 deletions

View file

@ -7,23 +7,31 @@ using namespace Upp;
CONSOLE_APP_MAIN
{
SeedRandom(0);
Vector<String> a;
std::vector<std::string> c;
for(int i = 0; i < N; i++) {
String s = AsString(Random()) + AsString(Random()) +
AsString(Random()) + AsString(Random());
AsString(Random()) + AsString(Random()) +
AsString(Random()) + AsString(Random())
;
a.Add(s);
c.push_back(s.ToStd());
}
{
Vector<String> b = clone(a);
RTIMING("Sort");
Sort(b);
{
RTIMING("Sort");
Sort(b);
}
}
{
std::vector<std::string> d = c;
RTIMING("std::sort");
std::sort(d.begin(), d.end());
{
RTIMING("std::sort");
std::sort(d.begin(), d.end());
}
}
}

View file

@ -1,10 +1,13 @@
description "Sorting non-SVO strings\377";
optimize_speed;
uses
Core;
file
LongSort.cpp;
LongSort.cpp,
info.txt;
mainconfig
"" = "";

View file

@ -0,0 +1,12 @@
TIMING std::sort : 542.00 ms - 542.00 ms (542.00 ms / 1 ), min: 542.00 ms, max: 542.00 ms, nesting: 1 - 1
TIMING Sort : 443.00 ms - 443.00 ms (443.00 ms / 1 ), min: 443.00 ms, max: 443.00 ms, nesting: 1 - 1
TIMING std::sort : 534.00 ms - 534.00 ms (534.00 ms / 1 ), min: 534.00 ms, max: 534.00 ms, nesting: 1 - 1
TIMING Sort : 384.00 ms - 384.00 ms (384.00 ms / 1 ), min: 384.00 ms, max: 384.00 ms, nesting: 1 - 1
-------------------------------
TIMING std::sort : 481.00 ms - 481.00 ms (481.00 ms / 1 ), min: 481.00 ms, max: 481.00 ms, nesting: 1 - 1
TIMING Sort : 296.00 ms - 296.00 ms (296.00 ms / 1 ), min: 296.00 ms, max: 296.00 ms, nesting: 1 - 1
TIMING std::sort : 443.00 ms - 443.00 ms (443.00 ms / 1 ), min: 443.00 ms, max: 443.00 ms, nesting: 1 - 1
TIMING Sort : 394.00 ms - 394.00 ms (394.00 ms / 1 ), min: 394.00 ms, max: 394.00 ms, nesting: 1 - 1