[GHC] #15524: Performance regression when using the GHC API to evaluate code compared to 8.4

#15524: Performance regression when using the GHC API to evaluate code compared to 8.4 -------------------------------------+------------------------------------- Reporter: vaibhavsagar | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.6.1-beta1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Runtime Unknown/Multiple | performance bug Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I've been in the process of updating IHaskell to support GHC 8.6 and the test suite has become agonisingly slow as compared to GHC 8.4 and below. I've been able to work around this by using `--enable-executable-dynamic` as suggested by `christiaanb` on `#ghc`but I thought this was worth reporting as a bug. I am using `ghc-8.6.1-alpha2` so it's possible that this has been fixed in `beta1`. To reproduce this on a Linux installation with Nix: 1. `git clone https://github.com/gibiansky/IHaskell --branch support- ghc-8-6 repro` 2. `cd repro` 3. Comment out `--enable-executable-dynamic` in `release-8.6.nix` 4. `nix-build release-8.6.nix` -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15524 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15524: Performance regression when using the GHC API to evaluate code compared to 8.4 -------------------------------------+------------------------------------- Reporter: vaibhavsagar | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.6.1-beta1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): The git hash of the commit for the repro is `ad0ec26cc976b7f263cc4781eead264b7080cc4e` just in case the branch mutates. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15524#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15524: Performance regression when using the GHC API to evaluate code compared to 8.4 -------------------------------------+------------------------------------- Reporter: vaibhavsagar | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.6.1-beta1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Old description:
I've been in the process of updating IHaskell to support GHC 8.6 and the test suite has become agonisingly slow as compared to GHC 8.4 and below. I've been able to work around this by using `--enable-executable-dynamic` as suggested by `christiaanb` on `#ghc`but I thought this was worth reporting as a bug. I am using `ghc-8.6.1-alpha2` so it's possible that this has been fixed in `beta1`.
To reproduce this on a Linux installation with Nix:
1. `git clone https://github.com/gibiansky/IHaskell --branch support- ghc-8-6 repro` 2. `cd repro` 3. Comment out `--enable-executable-dynamic` in `release-8.6.nix` 4. `nix-build release-8.6.nix`
New description: I've been in the process of updating IHaskell to support GHC 8.6 and the test suite has become agonisingly slow as compared to GHC 8.4 and below. I've been able to work around this by using `--enable-executable-dynamic` as suggested by `christiaanb` on `#ghc`but I thought this was worth reporting as a bug. To reproduce this on a Linux installation with Nix: 1. `git clone https://github.com/gibiansky/IHaskell --branch support- ghc-8-6 repro` 2. `cd repro` 3. Comment out `--enable-executable-dynamic` in `release-8.6.nix` 4. `nix-build release-8.6.nix` -- Comment (by vaibhavsagar): I've since tried this with GHC 8.6.1-beta1 and am seeing the same behaviour. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15524#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15524: Performance regression when using the GHC API to evaluate code compared to 8.4 -------------------------------------+------------------------------------- Reporter: vaibhavsagar | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.6.1-beta1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by vaibhavsagar: Old description:
I've been in the process of updating IHaskell to support GHC 8.6 and the test suite has become agonisingly slow as compared to GHC 8.4 and below. I've been able to work around this by using `--enable-executable-dynamic` as suggested by `christiaanb` on `#ghc`but I thought this was worth reporting as a bug.
To reproduce this on a Linux installation with Nix:
1. `git clone https://github.com/gibiansky/IHaskell --branch support- ghc-8-6 repro` 2. `cd repro` 3. Comment out `--enable-executable-dynamic` in `release-8.6.nix` 4. `nix-build release-8.6.nix`
New description: I've been in the process of updating IHaskell to support GHC 8.6 and the test suite has become agonisingly slow as compared to GHC 8.4 and below. I've been able to work around this by using `--enable-executable-dynamic` as suggested by `christiaanb` on `#ghc`but I thought this was worth reporting as a bug. To reproduce this on a Linux installation with Nix: 1. `git clone https://github.com/gibiansky/IHaskell` 2. `cd IHaskell` 3. `git checkout 6058cd4fac01a2023dbd09d174f1f8d4c36e7475` 4. Comment out `--enable-executable-dynamic` in `release-8.6.nix` 5. `nix-build release-8.6.nix` -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15524#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15524: Performance regression when using the GHC API to evaluate code compared to 8.4 -------------------------------------+------------------------------------- Reporter: vaibhavsagar | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.6.1-beta1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): "Agonisingly slow" sounds bad. What exactly does `--enable-executable- dynamic` do? Does anyone have a theory about what's going on? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15524#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15524: Performance regression when using the GHC API to evaluate code compared to 8.4 -------------------------------------+------------------------------------- Reporter: vaibhavsagar | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.6.1-beta1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by vaibhavsagar): To quantify, without `--enable-executable-dynamic` the test suite takes ~300s to run and with it enabled that time goes down to ~20s. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15524#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15524: Performance regression when using the GHC API to evaluate code compared to 8.4 -------------------------------------+------------------------------------- Reporter: vaibhavsagar | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.6.1-beta1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by darchon): `--enable-executable-dynamic` is the Cabal flag to ensure that the resulting executable is dynamically linked against all (Haskell) libraries. Among other things, it ensures that GHC is called with `-dynamic` to produce the executable. By default, Cabal/GHC produces executables that are statically linked again (Haskell) libraries. N.B. For Clash, I've had to enable dynamic linking since GHC 8.2 in order not to incur the performance penalty mentioned in this ticket. Since GHC itself is also dynamically linked (at least it is on Linux) I was never too bothered with having to dynamically link the Clash executables. Anyhow, this makes me wonder if we were to statically link the GHC executable (on linux) whether GHC will incur the same performance overhead as us GHC API users. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15524#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15524: Performance regression when using the GHC API to evaluate code compared to 8.4 -------------------------------------+------------------------------------- Reporter: vaibhavsagar | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.6.1-beta1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): This is quite interesting; it would be helpful if someone could paste a few backtraces from GDB (or perf a `perf` profile). If anything I would expect dynamic linking to make things slightly slower, not faster. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15524#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC