Skip to content

cabal buck2 is slow #25

Open
Open

Description

@michaelpj

At least for me, although I have a big project.

#24 and #23 fix most of the slowness in cabal buck2 itself. As far as I can tell, most of the rest is upstream cabal planning.

It seems like haskell/cabal#12463 is a significant source of memory usage in cabal (and hence slowness). I tested building with haskell/cabal#12500 and that removes almost all the remaining memory bloat.

With all of these together, runtime on my project goes from 90s to 10s. Can we do better? not sure.

Activity

  1. michaelpj commented on Nov 7, 2026

    @michaelpj
    CollaboratorAuthor

    #27 takes another 4s off.

  2. michaelpj commented on Nov 8, 2026

    @michaelpj
    CollaboratorAuthor

    Ah hmm, I've been mixing things up. Obviously it highly depends on whether cabal reuses its plan cache or not. haskell/cabal#12500 helps greatly with the case where it does use the cache, which is important for re-running cabal buck2. The other two help when cabal re-plans. Which is still pretty slow.

  3. simonmar commented on Nov 10, 2026

    @simonmar
    Owner

    Did you use -j by the way?

    Ideally cabal buck2 would do enough caching that it's virtually instant if nothing has changed, but I think this is mostly Cabal's problem rather than ours.

  4. michaelpj commented on Nov 10, 2026

    @michaelpj
    CollaboratorAuthor

    Yup, this is with -j. If cabal's plan is cached, it is indeed pretty fast so long as I include those upstream PRs that reduce the cache size. So that's probably fine. But we were also doing some things that made us unnecessarily slow when we have a new plan, so I do think fixing those is worthwhile. For the new user impression if nothing else!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions