Reduce latency of Revise.revise() #38906
Merged
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.
Perhaps the most annoying thing about Revise now is that the first revision is quite slow, about 3.1s on my machine.
This drops the time to 1.85s, a nice improvement.
This was curious, so by way of explanation I'm just going to paste the comments of both commits.
Commit 1:
Add precompiles to reduce time to first Revise.revise()
Perhaps the most annoying thing about Revise now is that the first
revision is quite slow, about 3.1s on my machine. This PR drops the time
to about 2.4s. Basically the idea is to precompile statements that
Revise will need.
Discovered via the new snoopi_deep/Core.Compiler.Timings framework.
Commit 2:
Internalize Revise precompiles into Base
For some reason (perhaps #32705?) most or all of these fail if they
are emitted as precompile statements, so this moves them into Base itself.
This drops the time for a revision down to 1.85s.
The commits are separate because it was an interesting discovery on its own, and the second is evidently ugly so it would be nice not to need it.