mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
.benchmarks
git-svn-id: svn://ultimatepp.org/upp/trunk@9399 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
30e44f2824
commit
9a8eac6b62
4 changed files with 45 additions and 0 deletions
29
benchmarks/LongSort/LongSort.cpp
Normal file
29
benchmarks/LongSort/LongSort.cpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include <Core/Core.h>
|
||||
#include <vector>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
#define N 1000000
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
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());
|
||||
a.Add(s);
|
||||
c.push_back(s.ToStd());
|
||||
}
|
||||
|
||||
{
|
||||
Vector<String> b = clone(a);
|
||||
RTIMING("Sort");
|
||||
Sort(b);
|
||||
}
|
||||
{
|
||||
std::vector<std::string> d = c;
|
||||
RTIMING("std::sort");
|
||||
std::sort(d.begin(), d.end());
|
||||
}
|
||||
}
|
||||
11
benchmarks/LongSort/LongSort.upp
Normal file
11
benchmarks/LongSort/LongSort.upp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
description "Sorting non-SVO strings\377";
|
||||
|
||||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
LongSort.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
|
||||
4
benchmarks/LongSort/init
Normal file
4
benchmarks/LongSort/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _LongSort_icpp_init_stub
|
||||
#define _LongSort_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue