Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,843
    • Issues 4,843
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 453
    • Merge requests 453
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #9646

Closed
Open
Created Sep 29, 2014 by erikd@trac-erikd

Simplifer non-determinism leading to 8 fold difference in run time performance

I've been chasing a weird performance bug for about a week now. I've reduced the testcase to the following git repo:

https://github.com/erikd/ghc-perfbug-test

The Readme.md file in that repo contains an explanation of how to reproduce the issue.

The benchmark program in the repo uses Criterion to test the performance of one particular function. Running the program in a particular way results into two significanlty different results.

The commands are:

make clean bench-integer.html
cp -f bench-integer.html bench-integer-slow.html
touch New3/GHC/Integer/Natural.hs && make bench-integer.html

The results for one function in the file New3/GHC/Integer/Natural.hs is 8 times slower in the first test that the second while the other test function always executes at about the speed.

I haven't been able to test this with ghc-7.6.3 because the code uses isTrue# which isn't available in 7.6.3.

Updated explanation:

Compiling the whole project results in the function under test running 4 times slower than the comparison. Touching the file containing the function under test and rebuilding the benchmark program results in the function under test runing 2 times faster than the comparison function.

Dumping intermediate files showed that the output of the simplifier was different enough to create this 8 fold difference in performance.

The simplifier should be deterministic. Same input file should result in the same simplifier output, preferably the output that results in 8 fold better performance.

Edited Mar 09, 2019 by erikd
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking