Skip to content

Stop pirating Base._searchindex and Base._rsearchindex #9

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

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

jakobnissen
Copy link
Contributor

Before, these methods were extended with new signatures using big unions. These big unions included Base types, which meant that certain methodinstances using concrete types of Base was being invalidated unnecessarily.

This PR stops the type piracy, cutting invalidations from 2000 -> 362 on recent Julia master.
This number of invalidations is much improved compared to Julia 1.8.2 due to recent invalidation hunting.

I think it's still worth investigating why StringViews cause so many invalidations.
Superficial snoop compiling suggests that a blank slate Julia sessions has a lot of abstract methodinstances related to strings compiled, such as thisind(::AbstractString, ::Int64).
If I understand SnoopCompile correctly, this means the problem might be in Base, not in this package.

Before, these methods were extended with new signatures using big unions.
These big unions included Base types, which meant that certain methodinstances
using concrete types of Base was being invalidated unnecessarily.

This PR stops the type piracy, cutting invalidations from 2000 -> 362.
@KristofferC KristofferC merged commit 1c364b4 into JuliaStrings:main Nov 9, 2022
@jakobnissen jakobnissen deleted the invals branch November 9, 2022 10:36
@stevengj
Copy link
Member

stevengj commented Nov 9, 2022

Thanks!

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.

3 participants