Skip to content

typemap: switch to IdDict#1069

Merged
quinnj merged 3 commits intoJuliaData:mainfrom
timholy:teh/typemap
Jan 19, 2023
Merged

typemap: switch to IdDict#1069
quinnj merged 3 commits intoJuliaData:mainfrom
timholy:teh/typemap

Conversation

@timholy
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
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
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.

2 participants