Skip to content
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

[4.4 backport] Improve CowData::insert performance #69

Merged

Conversation

jss2a98aj
Copy link
Member

Update CowData::insert to call ptrw() before loop, to avoid calling _copy_on_write for each item in the array, as well as repeated index checks in set and get.  For larger Vectors/Arrays, this makes inserts around 10x faster for ints, 3x faster for Strings, and 2x faster for Variants.  Less of an impact on smaller Vectors/Arrays, as a larger percentage of the time is spent allocating.
Copy link
Member

@sshiiden sshiiden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
👍

@Bioblaze Bioblaze merged commit f40745b into blazium-engine:blazium-dev Oct 19, 2024
22 checks passed
@jss2a98aj jss2a98aj deleted the cherry-pick-4.4-94353 branch October 23, 2024 23:28
@sshiiden sshiiden added cherry-pick Cherry-pick from upstream godot topic:core Changes related to core files. labels Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick Cherry-pick from upstream godot topic:core Changes related to core files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants