PerlGameDev / SDL

Rehashing the old perl SDL binding on cpan.org
http://search.cpan.org/dist/SDL
GNU General Public License v2.0
81 stars 29 forks source link

remove apparently unnecessary pump_events to smooth out performance profile #276

Closed wchristian closed 9 years ago

wchristian commented 9 years ago

Note ahead, in the following comment @kthakore observed issues around pump_events that i do not understand fully, and i would love if he could find the time to provide input on this:

SHA-1: 4aa0251049879b65b9466ad638d32960967c5cf6

That said, according to the documentation:

http://sdl.beuc.net/sdl.wiki/SDL_PumpEvents

Often the need for calls to SDL_PumpEvents is hidden from the user since SDL_PollEvent [...] implicitly call SDL_PumpEvents. [...] if you are not polling or waiting for events [...] you must call SDL_PumpEvents

http://sdl.beuc.net/sdl.wiki/SDL_PollEvent

this function implicitly calls SDL_PumpEvents

This means that removing it should have no deleterious effects.

At the same time, its presence does seem to cause some. In the graph in this screenshot you will notice occasional red spikes at the bottom. These are caused by pump_events taking more time than ordinary, and disappear with (on Win7) no noticable side effects when pump_events is removed.

Given that clear benefit, i would like to see this commit released live in a production release to see if it causes ill effects for anyone using SDL.

screenshot 2015-03-13 15 12 35

wchristian commented 9 years ago

Merged after approval by @FROGGS.