Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typemap: switch to IdDict #1069

Merged
merged 3 commits into from
Jan 19, 2023
Merged

typemap: switch to IdDict #1069

merged 3 commits into from
Jan 19, 2023

Conversation

timholy
Copy link
Contributor

@timholy timholy commented Jan 15, 2023

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 matches, which is much faster than subtyping (which is what isequal dispatches 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)

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
Copy link

codecov bot commented Jan 16, 2023

Codecov Report

Base: 90.22% // Head: 90.22% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (5cc809e) compared to base (94deaf4).
Patch coverage: 100.00% of modified lines in pull request are covered.

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           
Impacted Files Coverage Δ
src/chunks.jl 91.30% <ø> (ø)
src/file.jl 94.42% <ø> (ø)
src/rows.jl 84.81% <ø> (ø)
src/context.jl 88.50% <100.00%> (+0.03%) ⬆️

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@quinnj quinnj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Sounds like an overall win, and even for the API, it makes sense to use.

@quinnj quinnj merged commit cfb4ffb into JuliaData:main Jan 19, 2023
@timholy timholy deleted the teh/typemap branch January 20, 2023 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants