mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
.benchmarks
git-svn-id: svn://ultimatepp.org/upp/trunk@14602 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
e2f6ad4db3
commit
e9069fa3a5
3 changed files with 36 additions and 0 deletions
25
benchmarks/StringSet0/StringSet0.cpp
Normal file
25
benchmarks/StringSet0/StringSet0.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
String RandomString(int len)
|
||||
{
|
||||
String h;
|
||||
while(len-- > 0)
|
||||
h.Cat(Random(96) + 32);
|
||||
return h;
|
||||
}
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
Buffer<String> s(10000), t(10000);
|
||||
|
||||
for(int i = 0; i < 10000; i++)
|
||||
s[i] = RandomString(Random(20));
|
||||
|
||||
RTIMING("Set0");
|
||||
for(int j = 0; j < 10000; j++) {
|
||||
for(int i = 0; i < 10000; i++)
|
||||
t[i] = ~s[i];
|
||||
}
|
||||
}
|
||||
9
benchmarks/StringSet0/StringSet0.upp
Normal file
9
benchmarks/StringSet0/StringSet0.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
StringSet0.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
|
||||
|
|
@ -1,2 +1,4 @@
|
|||
OLD: VectorMap time: 5742398 ms
|
||||
NEW: VectorMap time: 5888610 ms
|
||||
|
||||
VectorMap time: 5524707 ms
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue