cabal-install should try to minimise the critical path when compiling a build graph concurrently

Open
#12,305 0 comments 3 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
haskell
Domain
build-system

Research direction

Start by tracing cabal-install's concurrent build-plan scheduler and how it currently applies FIFO ordering for -jsem. Compare a module-count-based priority with the reported critical path, and consider the work done when concurrent builds consistently prioritize critical-path packages without reducing parallelism.

Written by the indexing model from the issue text.

Description

cabal-install: cmd/build type: enhancement type: performance

Currently, cabal-install will execute the build plan in a naive FIFO order. However, when using e.g. -jsem, it would be more beneficial to prioritise packages on the critical path.

I did a quick experiment building pandoc with -j8. The critical path was 291s, but with the default build order the build took 334s.

If we estimate the build time of each component using the module count, it seems we get most of the benefits without knowing ahead of time what the critical path is. In my experiment, the build plan using this estimate landed at 296s.

Dominant language
Haskell
Stars
1.8k
Forks
766
Avg merge
5d 21h
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from haskell/cabal

All issues in haskell/cabal

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.