You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We on the pygame-ce team recently put up a pre-release of our next version, and multiple people noticed poor performance in it.
We tracked the issue all the way down to a few errant uses of SDL_GetColorKey in our code without doing SDL_HasColorKey first, and this SDL commit a6d5c1f. (Between SDL 2.29.2 and 2.29.3). Our issue on this: pygame-community/pygame-ce#2821
I believe what's happening is that our function was using SDL_GetColorKey to check if a surface had color key, and inside SDL this was calling SDL_SetError, and that SDL_SetError internally had to call SDL_getenv every time, slowing the whole loop down tremendously versus SDL 2.28.5
(In our defense, the SDL_HasColorKey function was added after our code was originally written)
We'll work on making sure our functions aren't inducing SDL_SetError calls when they don't need to of course, but I opened this just to let the SDL maintainers know that calling functions that set errors is now much less performant in SDL 2.30.0.
I'm not sure there's really anything actionable here? For this dynamic logging feature with SDL_LOGGING, SDL_SetError has to check the environment every time? Caching it would be antithetical to the spirit of setting a logging env variable? Again, just opening this informationally in case there is anything actionable with it.
Thanks for maintaining this library!
The text was updated successfully, but these errors were encountered:
Hello,
We on the pygame-ce team recently put up a pre-release of our next version, and multiple people noticed poor performance in it.
We tracked the issue all the way down to a few errant uses of
SDL_GetColorKey
in our code without doingSDL_HasColorKey
first, and this SDL commit a6d5c1f. (Between SDL 2.29.2 and 2.29.3). Our issue on this: pygame-community/pygame-ce#2821I believe what's happening is that our function was using
SDL_GetColorKey
to check if a surface had color key, and inside SDL this was calling SDL_SetError, and that SDL_SetError internally had to call SDL_getenv every time, slowing the whole loop down tremendously versus SDL 2.28.5(In our defense, the SDL_HasColorKey function was added after our code was originally written)
We'll work on making sure our functions aren't inducing SDL_SetError calls when they don't need to of course, but I opened this just to let the SDL maintainers know that calling functions that set errors is now much less performant in SDL 2.30.0.
I'm not sure there's really anything actionable here? For this dynamic logging feature with
SDL_LOGGING
, SDL_SetError has to check the environment every time? Caching it would be antithetical to the spirit of setting a logging env variable? Again, just opening this informationally in case there is anything actionable with it.Thanks for maintaining this library!
The text was updated successfully, but these errors were encountered: