Skip to content

Speed up fieldtypes_cached#1013

Merged
timholy merged 2 commits intomasterfrom
teh/ftcached
Feb 26, 2026
Merged

Speed up fieldtypes_cached#1013
timholy merged 2 commits intomasterfrom
teh/ftcached

Conversation

@timholy
Copy link
Owner

@timholy timholy commented Feb 25, 2026

xref #988

@timholy
Copy link
Owner Author

timholy commented Feb 25, 2026

@lassepe, any chance you can try this branch? On my machine it speeds up 1.12 quite substantially even without JuliaLang/julia#61156

Co-authored-by: Sebastian Pfitzner <pfitzseb@gmail.com>
@lassepe
Copy link

lassepe commented Feb 25, 2026

Nice, with julia 1.12.5 and this PR, revision time in my example from #988 (comment) is down to 20s (from >5min). I would still not consider #988 fixed with this but it is a huge improvement

@lassepe
Copy link

lassepe commented Feb 25, 2026

JuliaLang/julia#61156 has all sorts of weird precompilation errors for me so I cannot test with that combination (which may be due to the fact that my MWE uses GPU-related packages that don't currently work on julia master)

@timholy
Copy link
Owner Author

timholy commented Feb 25, 2026

Great! I just tried your example and saw similar speedup (>800s to 11s).

Do you think type-revision should still be off by default? It's not clear that JuliaLang/julia#61156 will make it any faster on top of this (it's still a useful change, though). So if it needs to be faster to be viable, we will need additional optimizations. JuliaLang/julia#60736 may provide a path forward (one could potentially restrict to names created after the revised type), but it may take a while to get backported to 1.12.

@lassepe
Copy link

lassepe commented Feb 25, 2026

I would want to do more tests in a real-world use case to make that call. My guess is that it can be enabled by default but that we shouldn't spawn a background thread to build the cache. I think many people implicitly rely on Revise being close to zero-overhead when they don't edit any code (so that it is not devastating to have Revise loaded during "production") but that stops being true if we have a background thread.

@timholy
Copy link
Owner Author

timholy commented Feb 26, 2026

Well, a background thread that completes its work fairly quickly would be less intrusive, no?

@timholy timholy merged commit 05d418d into master Feb 26, 2026
19 of 24 checks passed
timholy added a commit that referenced this pull request Feb 26, 2026
PR #1013 broke the `visit` tests but didn't fail CI, perhaps due to not
having yet merged #1012. This fixes the breakage.
timholy added a commit that referenced this pull request Feb 26, 2026
PR #1013 broke the `visit` tests but didn't fail CI, perhaps due to not
having yet merged #1012. This fixes the breakage.
@timholy timholy deleted the teh/ftcached branch March 2, 2026 09:40
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