Skip to content
solPublic

About

Benchmark a Haskell development system

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

81 Commits

Folders and files

Repository files navigation

ghc-bench: Benchmark a Haskell development system

Important

Results tagged with vm or WSL2 are heavily distorted and do not accurately reflect the capabilities of the corresponding hardware.

Benchmark results

CPU GHC 9.12.4 build hedgehog-1.7-dependencies hedgehog-1.7-build containers-0.8-ghci
Intel Core Ultra 9 285K 388s (6m28s) 17s 10s 4s
Intel Core Ultra 7 255H (-j8) 428s (7m8s) 23s 11s 4s
Intel Core Ultra 7 255H (-j6) 429s (7m9s) 23s 11s 4s
Intel Core i9-10900K 524s (8m44s) 28s 13s 5s
Intel Core i9-10900K (vm) 588s (9m48s) 29s 15s 6s
AMD EPYC-Genoa (vm) 661s (11m1s) 27s 21s 7s
Intel Core i7-1165G7 715s (11m55s) - - -
AMD Ryzen 5 5600X 730s (12m10s) 35s 16s 7s
AMD Ryzen 9 9900X3D (vm) 754s (12m34s) 33s 15s 5s
Intel Core i7-9700 (WSL2) 924s (15m24s) 49s 23s 7s
Intel Core Ultra 7 258V (WSL2) 995s (16m35s) 60s 18s 7s
Intel Core i5-3230M 1879s (31m19s) 112s (1m52s) 33s 12s
Intel Core 2 Duo P8700 3013s (50m13s) - - -

About

ghc-bench measures how well a system performs on Haskell development workloads compared to other systems.

It allows you to:

  • benchmark a system
  • submit benchmark results via GitHub issues
  • compare benchmark results across systems

This can be used to:

  • verify that a system delivers expected performance
  • understand the impact of a hardware upgrade
  • guide purchasing decisions

Workloads

I'm interested in the following workloads:

  • Building GHC
  • Building a Cabal project
  • Loading a project into ghci

Running ghc-bench

NOTE: If you are on Windows, you can run ghc-bench from a bootable USB drive (see next section).

Requirements:

  • cabal
  • ghc-9.12.4
  • ghc-bench

If all of these are on your PATH you can benchmark your system with:

$ ghc-bench

If you want to know about other options or need detailed instructions then read on.

Running ghc-bench from a bootable USB drive

Advantage

  • provides a consistent environment for benchmarking
  • does not require network connectivity; results are submitted via a QR code
  • based on archiso (see the corresponding GiHub Actions workflow)

Steps

Download https://github.com/sol/ghc-bench/releases/download/live-iso-image/ghc-bench-live-latest-x86_64.iso and prepare a bootable USB drive.

After booting into the live environment:

  1. First use --dry-run and make sure that you can submit results via the generated QR code:
    ghc-bench --qr --dry-run
    (make sure that the whole QR code fits on your screen and that you have a device that is capable of opening the corresponding URL)
  2. Run ghc-bench
    ghc-bench --qr
  3. Submit the result by scanning the generated QR code and opening the corresponding GitHub issue URL (if you are prompted to select an issue template, select "Benchmark result", this might happen if you are using the GitHub mobile app)

Running ghc-bench with ghcup

Install cabal, ghc-9.12.4, and ghc-bench:

$ ghcup install cabal
$ ghcup install ghc 9.12.4 --no-set
$ cabal update && cabal install -w ghc-9.12.4 ghc-bench

Run ghc-bench:

$ ghc-bench

Running ghc-bench with stack

Install cabal and ghc-bench:

$ stack --resolver=nightly-2026-04-11 install cabal-install
$ cabal update && stack --resolver=nightly-2026-04-11 exec --no-ghc-package-path -- cabal install ghc-bench

Run ghc-bench:

$ stack --resolver=nightly-2026-04-11 exec --no-ghc-package-path -- ghc-bench

Submitting a benchmark result

ghc-bench never submits results on its own.

Upon completion, it generates a URL that pre-fills a GitHub issue.

To submit a benchmark result, follow these two steps:

  1. Open the generated URL
  2. Submit the GitHub issue

Benchmark results are then processed by a GitHub Action.

Details

Running ghc-bench requires ~3.4G free space in /tmp/.

  • ghc-bench creates a separate temporary directory for each benchmark run under /tmp/ghc-bench and always cleans up after itself.
  • The GHC 9.12.4 source tarball is stored at ~/.cache/ghc-bench/ghc-9.12.4-src.tar.gz and reused between benchmark runs.
  • cabal is used to build Hadrian (the GHC build system)
    • any missing Hadrian dependencies are installed to ~/.local/state/cabal/store; apart from the GHC tarball, this is the only other situation where running ghc-bench may modify anything outside of /tmp/ghc-bench

Exact steps performed by ghc-bench:

  1. Download the GHC 9.12.4 source tarball to ~/.cache/ghc-bench/ghc-9.12.4-src.tar.gz
  2. Unpack GHC sources into a temporary directory under /tmp/ghc-bench
  3. Set the environment variable GHC to the absolute path of ghc-9.12.4
  4. Run ./configure
  5. Build Hadrian (not measured as part of the benchmark) by invoking hadrian/build --help to trigger dependency compilation
  6. Run hadrian/build -j$(nproc) --flavour=quickest

Auditing

About

Benchmark a Haskell development system

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

⌂