ultimatepp/benchmarks/CoSort/CoSort.cpp
cxl 15dbf1f7d0 .benchmarks
git-svn-id: svn://ultimatepp.org/upp/trunk@14437 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2020-05-08 08:12:34 +00:00

43 lines
597 B
C++

#include <Core/Core.h>
using namespace Upp;
#ifdef _DEBUG
#define N 10000
#else
#define N 100000000
#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);
}
#if 0
{
CoWork::SetPoolSize(400);
auto h1 = clone(h);
TimeStop tm;
CoSort(h1);
RLOG("CoSort (big pool) " << tm);
}
#endif
RLOG("Exit");
}