Skip to content

perf: Group together packages by repo when verifying tarballs (backport #10112) - #10121

Merged
mergify[bot] merged 1 commit into
3.12from
mergify/bp/3.12/pr-10112
Jun 18, 2024
Merged

mergify[bot] merged 1 commit into
3.12from
mergify/bp/3.12/pr-10112

Conversation

@mergify

@mergify mergify Bot commented Jun 18, 2024

Copy link
Copy Markdown
Contributor

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:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
  • Manual QA notes have been included.
  • Tests have been added. (Ask for help if you don’t know how to write them! Ask for an exemption if tests are too complex for too little coverage!)

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:

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

This is an automatic backport of pull request #10112 done by [Mergify](https://mergify.com).

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)
@ulysses4ever ulysses4ever added the squash+merge me Tell Mergify Bot to squash-merge label Jun 18, 2024
@mergify
mergify Bot merged commit a29092e into 3.12 Jun 18, 2024
@mergify
mergify Bot deleted the mergify/bp/3.12/pr-10112 branch June 18, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport squash+merge me Tell Mergify Bot to squash-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants