You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-18 14:21:41 +00:00
When profiling Dome Keeper, I found that in physics_process a HashMap gets cleared a lot, which ends up calling the Variant destructor. Calling Variant::clear() dominates this operation. By not uselessly setting the Type to NIL on destruction we save about 50% of time. This is likely because if there is a simple type in the Variant that doesn't need destructing, but now we write when we should just drop the Variant altogether. Since the value of Variant::type should be unobservable after destruction this doesn't change any outward behavior.
33 KiB
33 KiB