-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve resize performance by switching to AutoArrayHashMapUnmanaged
I noticed that the HashMap iterator showed up prominently in Instruments when quickly resizing Ghostty. I think this is related to the [tombstone issue](ziglang/zig#17851), where the `next()` function has to skip unused meta-nodes. In that same issue, Andrew is suggesting that the non-array hashmap might get deleted from the standard library. After switching to `AutoArrayHashMapUnmanaged`, iteration barely shows up anymore. Deletion from the pin list should also be fast as swapRemove is used (order does not need to be preserved). Question is if insertion performance is negatively affected, though I'm not seeing anything obvious. Still, checking this PR for any perf regressions might be a good idea. If this pans out, there are more places where this switch might be beneficial.
- Loading branch information
1 parent
edea928
commit 2e88ff1
Showing
1 changed file
with
40 additions
and
59 deletions.
There are no files selected for viewing
This file contains 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