ultimatepp/benchmarks/CoSort/CoSort.cpp
cxl c6b0216390 .benchmarks
git-svn-id: svn://ultimatepp.org/upp/trunk@10152 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2016-08-08 07:31:37 +00:00

43 lines
613 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);
}
{
CoWork::SetPoolSize(400);
auto h1 = clone(h);
TimeStop tm;
CoSort(h1);
RLOG("CoSort (big pool) " << tm);
}
Thread::ShutdownThreads();
RLOG("Exit");
}