typemap: switch to IdDict#1069
Merged
quinnj merged 3 commits intoJuliaData:mainfrom Jan 19, 2023
timholy:teh/typemap
Merged
Conversation
When using types as keys, IdDict is essentially always preferred: - it uses `@nospecialize` on all operations, reducing latency - it uses pointer comparisons to test for matchs, which is much faster than subtyping (which is what `isequal` dispatches to).
Courtesy of my settings for vscode
Codecov ReportBase: 90.22% // Head: 90.22% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1069 +/- ##
=======================================
Coverage 90.22% 90.22%
=======================================
Files 9 9
Lines 2270 2271 +1
=======================================
+ Hits 2048 2049 +1
Misses 222 222
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
quinnj
approved these changes
Jan 19, 2023
Member
quinnj
left a comment
There was a problem hiding this comment.
Thanks! Sounds like an overall win, and even for the API, it makes sense to use.
quinnj
pushed a commit
that referenced
this pull request
Jan 12, 2026
* `typemap`: switch to IdDict When using types as keys, IdDict is essentially always preferred: - it uses `@nospecialize` on all operations, reducing latency - it uses pointer comparisons to test for matchs, which is much faster than subtyping (which is what `isequal` dispatches to). * Lots of trailing whitespace fixes Courtesy of my settings for vscode * One more spot
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.
When using types as keys, IdDict is essentially always preferred:
@nospecializeon all operations, reducing latencyisequaldispatches to).The second commit adds a lot of noise in the form of whitespace fixes.
Feel free to drop this commit if you prefer (and easiest to review by
suppressing whitespace changes).
This fixes some invalidations (see #1061)