diff options
author | aaronp64 <aaronp.code@gmail.com> | 2024-07-13 21:36:11 -0400 |
---|---|---|
committer | aaronp64 <aaronp.code@gmail.com> | 2024-07-15 14:01:19 -0400 |
commit | c1afe7dcdf98ff4f34a91e2290e86630df60c0dd (patch) | |
tree | 3778783f8645a05270101ab9919adce1ce7c4225 /modules/gdscript/gdscript_compiler.cpp | |
parent | 97b8ad1af0f2b4a216f6f1263bef4fbc69e56c7b (diff) | |
download | redot-engine-c1afe7dcdf98ff4f34a91e2290e86630df60c0dd.tar.gz |
Improve CowData::insert performance
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.
Diffstat (limited to 'modules/gdscript/gdscript_compiler.cpp')
0 files changed, 0 insertions, 0 deletions