You were correct - these two revisions are the cause for the performance
regression.
SDL2_gfx relies on pixel and line rendering to compose the primitives.
All primitives seem to experience a slowdown, sometimes a significant one.
$ ./testgfx.exe --renderer OpenGL
INFO: SDL2_gfx 1.0.0: testgfx
INFO: Platform: Windows
INFO: Renderer 0: opengl (Accelerated)
…
Primitive Orig HG Run1 Orig HG Run2 Orig HG Avg. -2 Rev Run1 -2 Rev
Run2 -2 Rev Avg Speedup with 7840&7842 reverted
Pixel 712,348 744,727 728,538 1,489,455 1,820,444 1,654,949 227%
Hline 390,095 390,095 390,095 431,158 431,158 431,158 111%
Vline 390,095 390,095 390,095 431,158 431,158 431,158 111%
Rectangle 372,364 390,095 381,229 1,638,400 1,638,400 1,638,400 430%
RoundedRectangle 26,771 26,597 26,684 53,195 51,848 52,521 197%
Box 1,024,000 1,170,286 1,097,143 1,365,333 1,638,400 1,501,867 137%
Line 372,364 390,095 381,229 455,111 431,158 443,135 116%
Circle 8,266 8,176 8,221 21,787 21,445 21,616 263%
AACircle 3,846 3,910 3,878 9,846 9,776 9,811 253%
FilledCircle 12,431 6,798 9,615 18,204 17,430 17,817 185%
Ellipse 6,715 6,715 6,715 17,504 17,210 17,357 258%
AAEllipse 3,710 3,720 3,715 9,320 9,153 9,236 249%
FilledEllipse 12,469 12,450 12,459 18,286 17,504 17,895 144%
Bezier 1,212 1,217 1,215 1,836 1,760 1,798 148%
Polygon 364,067 341,313 352,690 1,365,250 1,365,250 1,365,250 387%
AAPolygon 1,212 1,256 1,234 3,165 3,148 3,157 256%
FilledPolygon 4,137 4,146 4,142 6,169 5,769 5,969 144%
Trigon 364,089 356,174 360,131 1,365,333 1,260,308 1,312,821 365%
Arc 17,751 18,044 17,897 46,283 46,283 46,283 259%
Pie 210,051 207,392 208,722 348,596 341,333 344,965 165%
FilledPie 14,655 14,681 14,668 20,845 19,811 20,328 139%
ThickLine 618 616 617 1,648 1,631 1,639 266%
TOTAL 219%On 11/4/2013 8:17 PM, Sam Lantinga wrote:
Offhand, I’m guessing it’s the line change to glDrawArrays() that’s
affecting you.
You should be able to test that hypothesis by backing out these two
changesets:
Use vertex arrays for drawing points in addition to lines · libsdl-org/SDL@20f5167 · GitHub
Fixed bug 2158 - Pixel missing in SDL_RenderDrawLines · libsdl-org/SDL@82b8e6d · GitHub
Does your program draw so many lines that this change causes
real-world performance issues for you?
On Mon, Nov 4, 2013 at 8:17 AM, Andreas Schiffler <@Andreas_Schiffler mailto:Andreas_Schiffler> wrote:
Yup - that sounds like a regression.
Could you open a bug on https://bugzilla.libsdl.org with repro
steps (either some test source code and/or steps using SDL2_gfx)
and your measurements numbers that show the difference.
On 11/4/2013 2:42 AM, Dark_Oppressor wrote:
Andreas Schiffler wrote:
Not really Smile
- thickLineRGBA is slow; the algorithm is a port from a PostScript
renderer - it is functional & graphically correct, but not very
optimized
- thickLineRGBA with a width of 1 should be special-cased to use the
regular line algorithm - I'll fix that in the next SDL2_gfx release
Cool, thanks Smile
At this point, I'm seeing a pretty big performance drop in both
thickLineRGBA and SDL_RenderDrawLine when moving from SDL 2.0.0
to 2.0.1. This was the case on Windows, OS X, and Linux. Does
this sound bug-like? Something has definitely changed, and I
don't see how it could be on my end. All I changed was one
library, and the problem is on a variety of OSs, architectures,
and physical machines.
_______________________________________________
SDL mailing list
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org