mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
Core: memset8__ micro-optimisation, Painter: Clear fix and co support, new benchmarks
This commit is contained in:
parent
3d4911c266
commit
867efb4927
7 changed files with 108 additions and 3 deletions
9
benchmarks/PainterClear/PainterClear.upp
Normal file
9
benchmarks/PainterClear/PainterClear.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
46
benchmarks/PainterClear/main.cpp
Normal file
46
benchmarks/PainterClear/main.cpp
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
ImagePainter iw(4000, 2000);
|
||||
iw.Co();
|
||||
|
||||
for(int i = 0; i < 1000; i++) {
|
||||
{
|
||||
RTIMING("Clear");
|
||||
iw.Clear();
|
||||
}
|
||||
{
|
||||
RTIMING("Clear 2");
|
||||
iw.Clear();
|
||||
}
|
||||
{
|
||||
RTIMING("Rect");
|
||||
iw.DrawRect(0, 0, 4000, 2000, White());
|
||||
iw.Finish();
|
||||
}
|
||||
{
|
||||
RTIMING("Fill");
|
||||
iw.Circle(2000, 1000, 900).Fill(Blue());
|
||||
iw.Finish();
|
||||
}
|
||||
{
|
||||
RTIMING("Stroke");
|
||||
iw.Circle(2000, 1000, 900).Stroke(2, LtRed());
|
||||
iw.Finish();
|
||||
}
|
||||
{
|
||||
RTIMING("Blend");
|
||||
iw.Circle(2000, 1000, 900).Fill(200 * Blue());
|
||||
iw.Finish();
|
||||
}
|
||||
}
|
||||
|
||||
TopWindow win;
|
||||
ImageCtrl h;
|
||||
h.SetImage(iw);
|
||||
win << h.SizePos();
|
||||
win.Run();
|
||||
}
|
||||
30
benchmarks/memset/memset.cpp
Normal file
30
benchmarks/memset/memset.cpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
Buffer<byte> h(1024*1024*30);
|
||||
|
||||
for(int i = 0; i < 1000000; i++) {
|
||||
{
|
||||
RTIMING("32KB memset");
|
||||
memset(h, 0, 1024 * 32);
|
||||
}
|
||||
{
|
||||
RTIMING("32KB memset8");
|
||||
memset8(h, 0, 1024 * 32);
|
||||
}
|
||||
{
|
||||
RTIMING("32KB memset32");
|
||||
memset32(h, 31525874, 1024 * 32 / 4);
|
||||
}
|
||||
{
|
||||
RTIMING("32KB loop 32");
|
||||
dword *s = (dword *)~h;
|
||||
dword *e = s + 1024 * 32 / 4;
|
||||
while(s < e)
|
||||
*s++ = 31515927;
|
||||
}
|
||||
}
|
||||
}
|
||||
9
benchmarks/memset/memset.upp
Normal file
9
benchmarks/memset/memset.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
memset.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue