haskell / haskell/cabal

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
cabal-install: cmd/build type: enhancement type: performance
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

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.

Contributor guide

Open the contributing guide

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.