Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
336: Add `instance_id_or_none_unchecked` to `Gd` r=Bromeon a=WinstonHartnett `Gd::instance_id` and `Gd::instance_id_or_none` both end up calling `is_instance_id_valid`, which itself eventually calls `ObjectDB::get_instance`, which actually locks the `ObjectDB` spinlock. For most users, this is fine, but if you need to query _a lot_ of instance IDs and you're sure that the cached instance IDs are valid, this becomes a performance problem (for example, doing instance ID voodoo during parallel scene creation). This PR adds an `instance_id_or_none_unchecked` method to `Gd` that skips the validity check and just returns the `Gd`'s cached ID (if present). Co-authored-by: Winston Hartnett <winstonhartnett@gmail.com>
- Loading branch information