ultimatepp/benchmarks/CoSort/CoSort.cpp
cxl 2582d7f364 .benchmarks
git-svn-id: svn://ultimatepp.org/upp/trunk@10262 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2016-10-04 08:34:25 +00:00

45 lines
636 B
C++

#include <Core/Core.h>
using namespace Upp;
#ifdef _DEBUG
#define N 10000
#else
#define N 10000000
#endif
CONSOLE_APP_MAIN
{
StdLogSetup(LOG_FILE|LOG_COUT);
Vector<String> h;
for(int i = 0; i < N; i++)
h.Add(AsString(Random()));
{
auto h1 = clone(h);
TimeStop tm;
Sort(h1);
RLOG("Sort " << tm);
}
{
auto h1 = clone(h);
TimeStop tm;
CoSort(h1);
RLOG("CoSort " << tm);
}
#ifdef CPU_64
{
CoWork::SetPoolSize(400);
auto h1 = clone(h);
TimeStop tm;
CoSort(h1);
RLOG("CoSort (big pool) " << tm);
}
#endif
Thread::ShutdownThreads();
RLOG("Exit");
}