Skip to content

Add PrecompileTools precompilation setup #129

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

Closed
wants to merge 6 commits into from
Closed

Conversation

pbrehmer
Copy link
Collaborator

Here we add a precompilation setup using PrecompileTools.jl to cut down on the long time-to-first-execution (TTFX) of some functions (in particular anything involving AD takes a very long time to execute). The precompile.jl file covers most of the common uses but doesn't iterate through all possible permutations to still ensure that the initial precompilation doesn't take too long. Currently it takes a couple of minutes.

While this really speeds up the TTFX on the user side, it might be annoying from the developer side since any changes will result in re-precompilation of the package. This can be disabled by commenting out include("precompile.jl) locally or as described in the PrecompileTools docs.

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/PEPSKit.jl 87.50% <ø> (ø)
src/precompile.jl 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pbrehmer
Copy link
Collaborator Author

In principle this already works quite well I think. The only thing that is undesirable is that now all test individually have to run through the precompilation routine. Also I will try to speed things up further...

@pbrehmer
Copy link
Collaborator Author

Precompilation times now seem manageable:

  • Ubuntu/Windows CI: ~10 mins
  • MacOS CI: ~8 mins
  • My local Ubuntu machine: ~7 mins

However, I had to take out all fermionic stuff from the workload since it more than doubles the precompilation times.

@pbrehmer pbrehmer requested a review from lkdvos February 12, 2025 10:08
@pbrehmer
Copy link
Collaborator Author

While having a PrecompileTools setup does speed up TTFX quite a bit, it's not necessarily useful to have this precompiled by default and shipped with the package itself. I will add a page on PrecompileTools when we set up the new docs so that every user can set up their own precompilation routine. Let me close this PR for now :-)

@pbrehmer pbrehmer closed this Mar 13, 2025
@pbrehmer pbrehmer mentioned this pull request Mar 19, 2025
12 tasks
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.

1 participant