Skip to content

cabal-install: add --build-timings flag#11769

Open
sheaf wants to merge 1 commit intohaskell:masterfrom
sheaf:build-timings
Open

cabal-install: add --build-timings flag#11769
sheaf wants to merge 1 commit intohaskell:masterfrom
sheaf:build-timings

Conversation

@sheaf
Copy link
Copy Markdown
Collaborator

@sheaf sheaf commented Apr 27, 2026

This new flag makes cabal-install dump timing information for the various stages of building a package. This allows us to better see how much time is spending in configure/build stages.

I used this to figure out where we were wasting time for PRs #11767 and #11768. I think it makes sense to add it as a flag so that all users can get better observability (a bit like the -dshow-passes GHC flag).


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

Copy link
Copy Markdown
Member

@TeofilC TeofilC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me!

I am currently working on a tool for nicely visualizing module graph build times. I think I could probably be able to use the same tool for visualizing package graph build times.

If this is accepted, then I might make a followup PR to also output this information to a file in dist-newstyle (along with dependency information) and that should work well with my tool

Comment thread cabal-install/src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs Outdated
Comment thread cabal-install/src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs Outdated
Copy link
Copy Markdown
Member

@Mikolaj Mikolaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Comment thread changelog.d/build-timings.md
@ulysses4ever
Copy link
Copy Markdown
Collaborator

Thanks for the PR!

I don't want to drag this longer than necessary, but I can't stand asking: how about a machine-readable version of this? Basically, spitting a CSV might be nice. But again it's more of food-for-thought kind of quetsion rather than an actual concern.

@sheaf
Copy link
Copy Markdown
Collaborator Author

sheaf commented May 4, 2026

Thanks for the PR!

I don't want to drag this longer than necessary, but I can't stand asking: how about a machine-readable version of this? Basically, spitting a CSV might be nice. But again it's more of food-for-thought kind of quetsion rather than an actual concern.

Yes, that would be nice as well. I think I will let @TeofilC take care of that, given that he has a direct use case for it. I just put up this PR as it's what I was using to benchmark #11768 and #11767 and I thought it might be generally useful.

@sheaf sheaf force-pushed the build-timings branch from 2a9032c to 85d962c Compare May 4, 2026 08:24
This new flag makes cabal-install dump timing information for the
various stages of building a package. This allows us to better see how
much time is spending in configure/build stages.
@sheaf sheaf force-pushed the build-timings branch from 85d962c to e4e4801 Compare May 4, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants