-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDL_malloc num_allocations tracking should be optional #11099
Comments
There are a few areas where things like this could be filtered out at build-time. I'd be interested in using it. In the mean time, is |
If I understand the code correctly, the atomics are outside the memory function, so it wouldn't help: Lines 6431 to 6436 in 9f17028
The atomics could be made optional by providing a memory function that does recording and one that doesn't, perhaps. |
I see how I hope this gets looked at when considered for disabling mentioned here |
We're going to add an |
While kicking the tires on SDL_GPU, I noticed that SDL_AddAtomicInt_REAL was near the top of my profiles (7th, to be precise). Most of the calls to this function are from SDL_malloc, where it tracks the amount of memory allocated. This probably indicates that SDL_GPU has high malloc traffic (and it does), but it also seems like it would be an easy small win for performance-sensitive users to not do these atomics on every malloc/free operation, or find a way to make them cheaper. Alternately, you could make them optional so that people like me can turn them off to squeeze out extra performance on underpowered targets like Steam Deck.
To provide concrete numbers, SDL_AddAtomicInt_REAL was 527ms of exclusive execution time in a ~75000ms long capture, so around 0.7% of execution time.
The text was updated successfully, but these errors were encountered: