
#14256: GHCi is faster than compiled code -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 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 saep): I think the problem is with the benchmarking tool. I used apache bench and got the same results as above. Just today, a colleague recommended to use wrk (https://github.com/wg/wrk) for benchmarking and with it, the compiled binary was always faster. I initially suspected that the threaded runtime of the compiled binary could have been responsible for the slow-down because running the server from ghci only occupied 1 core whereas the binary used all my 8(ish) cores. When I only use "-O2" and not "-O2 -threaded -rtsopts -with- rtsopts=-N", the apache bench measurements of the compiled binary were, as intuitively expected, better than the ghci ones. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14256#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler