Skip to content

iostream: Create properties on-demand instead of upfront.#15980

Open
icculus wants to merge 1 commit into
libsdl-org:mainfrom
icculus:sdl3-iostream-props-on-demand
Open

iostream: Create properties on-demand instead of upfront.#15980
icculus wants to merge 1 commit into
libsdl-org:mainfrom
icculus:sdl3-iostream-props-on-demand

Conversation

@icculus

@icculus icculus commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator
  • I confirm that I am the author of this code and release it to the SDL project under the Zlib license. This contribution does not contain code from other sources, including code generated by a Large Language Model ("AI").

It's possible that IOStreams might get created and thrown away a lot, perhaps at any point in an app's lifetime, so it makes sense to avoid doing the work of maintaining a properties group for each, if the app hasn't requested it, since this requires a bunch of allocations and locks.

It's not necessarily worth doing this for other SDL objects, like SDL_Window, since there are likely to only be a few of them, and likely created at startup and living for the entire lifespan of the app.

Fixes #14436.

It's possible that IOStreams might get created and thrown away a lot, perhaps
at any point in an app's lifetime, so it makes sense to avoid doing the work
of maintaining a properties group for each, if the app hasn't requested it,
since this requires a bunch of allocations and locks.

It's not necessarily worth doing this for other SDL objects, like SDL_Window,
since there are likely to only be a few of them, and likely created at startup
and living for the entire lifespan of the app.

Fixes libsdl-org#14436.
@icculus icculus added this to the 3.6.0 milestone Jul 12, 2026
@icculus icculus self-assigned this Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proliferation & performance of SDL_properties

1 participant