haskell / haskell/criterion

use performMajorGC

Open
#257 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
523
Forks
89
PR merge metrics
No merged PRs in 30d

Description

In 1.4.0.0 the `performGC` was changed to `performMinorGC`

> * Use `performMinorGC` rather than `performGC` to update garbage collection
statistics. This improves the benchmark performance of fast functions on large
objects.

While that is true, it also "destroys" accuracy of a bit slower functions. In case when `measure` (which allocates relatively big `Measure` object on each iteration, and there are enough iterations, triggers a GC which must be major: that run is a massive outlier.

IMHO, it's simpler just to accept that GC have to be run, this is not right place to optimize for performance.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating measure and its current performMinorGC call, then inspect how garbage-collection statistics are gathered for each iteration. Done means the benchmark accounts for major collections again and no longer hides the large outlier described in the issue; use the existing benchmark or measurement checks to verify the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
performance
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.