btzy / circuit-sandbox

GNU General Public License v3.0
3 stars 1 forks source link

Slow rendering when at 1x zoom when using large screen #16

Closed btzy closed 6 years ago

btzy commented 6 years ago

Is rendering playarea slow when zoomed out even with -O3?

xsot commented 6 years ago

Yes. I suspect it may be underperforming because of my gpu driver on linux. I can compare the performance on windows once we build the next release version.

btzy commented 6 years ago

Profiling results (on Windows/DirectX), when in selection mode with a sizable object selected: 1) Code spends most time inside PlayArea::render() - more than 76% of total execution time. 2) Of 22,734 samples inside PlayArea::render(), the large majority of them are in SDL_CreateTextureFromSurface(), and some of them are in renderPlayAreaSurface(). 3) Some goes to creating and freeing the surface.

playarea.cpp: image

selectionaction.hpp image

Things that can be done:

btzy commented 6 years ago

Optimized sufficiently with a5369ae8fc3569e45eaad380246ceba51e026048 and da34d8bf5d2b68f9c0a6343fb465bc05d79faec1.