Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,247
    • Issues 4,247
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 393
    • Merge Requests 393
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #10557

Closed
Open
Opened Jun 21, 2015 by thomie@trac-thomie

Use `+RTS -G1` for more stable residency measurements

Tests that measure peak_megabytes_allocated and max_bytes_used can be very sensitive to small changes in, well, just about anything: order of command line flags, what should be irrelevant compiler patches, minor changes in the test file to compile.

From Note [residency] in testsuite/tests/perf/compiler/all.T:

# Residency (peak_megabytes_allocated and max_bytes_used) is sensitive
# to when the major GC runs, which makes it inherently inaccurate.
# Sometime an innocuous change somewhere can shift things around such
# that the samples occur at a different time, and the residency
# appears to change (up or down) when the underlying profile hasn't
# really changed.

I propose setting +RTS -G1 for these tests. This seems to make them more robust to small changes, as can be seen in the following two graphs, adapted from the test for #9675:

https://ghc.haskell.org/trac/ghc/attachment/ticket/9675/T9675-peak_megabytes_allocated.png https://ghc.haskell.org/trac/ghc/attachment/ticket/9675/T9675-max_bytes_used.png

This shows the peak_megabytes_allocated and max_bytes_used as a function of the number fields when compiling a single record:

data Foo = Foo
   { field1 :: Int -> Int
   , field2 :: Int -> Int
   ...

The default GHC -O line is wiggling up and down, while the GHC -O +RTS -G1 line is nice and smooth, which is what we want.

I don't know if making this change defeats the purpose of some tests, which is why I'm opening this ticket.

Trac metadata
Trac field Value
Version 7.10.1
Type Task
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Test Suite
Test case
Differential revisions
BlockedBy
Related
Blocking
CC ezyang, thoughtpolice
Operating system
Architecture
Assignee
Assign to
8.0.1
Milestone
8.0.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#10557