.benchmarks

git-svn-id: svn://ultimatepp.org/upp/trunk@14476 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2020-05-15 08:03:34 +00:00
parent 756079d205
commit f842c6672b

View file

@ -2,6 +2,20 @@
using namespace Upp;
void CoFill(RGBA *t, RGBA c, int len)
{
const int CHUNK = 1024;
std::atomic<int> ii(0);
CoDo([&] {
for(;;) {
int pos = CHUNK * ii++;
if(pos >= len)
break;
Fill(t + pos, c, min(CHUNK, len - pos));
}
});
}
GUI_APP_MAIN
{
Color c = Red();
@ -19,5 +33,9 @@ GUI_APP_MAIN
RTIMING("Fill");
Fill(b, c, len);
}
{
RTIMING("CoFill");
CoFill(b, c, len);
}
}
}