ClassDB: Use AHashMap for property_setget and constant/signal_map#112129
Merged
Repiteo merged 1 commit intogodotengine:masterfrom Oct 29, 2025
Merged
ClassDB: Use AHashMap for property_setget and constant/signal_map#112129Repiteo merged 1 commit intogodotengine:masterfrom
ClassDB: Use AHashMap for property_setget and constant/signal_map#112129Repiteo merged 1 commit intogodotengine:masterfrom
Conversation
Member
That makes sense. Profiling captures a stream over time. So if you have more FPS, then a given function will be called more times and will consume more cycles. |
ClassDB: Use AHashMap for property_setgetClassDB: Use AHashMap for property_setget and constant/signal_map
Contributor
Author
|
Further experimenting showed that modifying I tried to apply to Benchmarks updated to the new changes. |
Contributor
|
Thanks! |
This was referenced Oct 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(During testing I found this is part of #101340, but this is a simple and harmless change that wouldn't require a whole rewrite and has a very low chance of regressions, so I opened it anyway)
ClassDB::get_property()is one of the biggest bottlenecks in GDScript (actually, inVariantitself) as seen when profiling.I did a bit of experimenting by making
property_setget,constant_mapandsignal_mapAHashMapinstead ofHashMap. Tests were run on a modified version of Gaijin's BunnyMark (stress test of many GDScript instances) in a release production build, 3 times, with the average FPS of 20 seconds written down:500 bunnies:
master1000 bunnies:
master5000 bunnies:
masterOverall, FPS was increased between a minimum of 2.8%.
During profiling on a
template_debugbuild with debug symbols,ClassDB::get_property()almost doubled in cycles, but it was mostly caused byMethodBindTRC::call(), which I believe means a bottleneck removed rather than a bottleneck added.Build sizes did not change.