Repository navigation
perf: Group together packages by repo when verifying tarballs (backport #10112) - #10121
Merged
Merged
Conversation
verifyFetchedTarball has the effect of deserialising the index tarball (see call to Sec.withIndex). verifyFetchedTarball is called individually for each package in the build plan (see ProjectPlanning.hs). Not once per repo. The hackage tarball is now 880mb so it takes a non significant amount of time to deserialise this (much better after haskell/tar#95). This code path is important as it can add 1s with these 38 calls on to the initial load of a project and scales linearly with the size of your build tree. Reproducer: Simple project with "lens" dependency deserialises the index tarball 38 times. Solution: Refactor verifyFetchedTarball to run once per repo rather than once per package. In future it would be much better to refactor this function so that the items are not immediately grouped and ungrouped but I didn't want to take that on immediately. Fixes #10110 (cherry picked from commit 7d46115)
7 tasks
ulysses4ever
approved these changes
Jun 18, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
verifyFetchedTarball has the effect of deserialising the index tarball (see call to Sec.withIndex).
verifyFetchedTarball is called individually for each package in the build plan (see ProjectPlanning.hs). Not once per repo.
The hackage tarball is now 880mb so it takes a non significant amount of time to deserialise this (much better after haskell/tar#95).
This code path is important as it can add 1s with these 38 calls on to the initial load of a project and scales linearly with the size of your build tree.
Reproducer: Simple project with "lens" dependency deserialises the index tarball 38 times.
Solution: Refactor verifyFetchedTarball to run once per repo rather than once per package.
In future it would be much better to refactor this function so that the items are not immediately grouped and ungrouped but I didn't want to take that on immediately.
Fixes #10110
Please read Github PR Conventions and then fill in one of these two templates.
Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
Template B: This PR does not modify behaviour or interface
E.g. the PR only touches documentation or tests, does refactorings, etc.
Include the following checklist in your PR:
This is an automatic backport of pull request #10112 done by [Mergify](https://mergify.com).