[GHC] #14256: GHCi is faster than compiled code

GHC ghc-devs at haskell.org
Wed Sep 20 08:53:33 UTC 2017


#14256: GHCi is faster than compiled code
-------------------------------------+-------------------------------------
           Reporter:  mpickering     |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 A stackoverflow user Milad Zahedi reports that running his code in GHCi is
 50x faster than compiling it and running the compiled binary.


 > Today I did little benchmarking on my local machine to compare plain
 text speed of different Haskell  web frameworks, and I noticed something
 strange. Almost all the frameworks that I tested, performed better when
 they were run from GHCi compared to compiled version. here are my results
 >
 {{{
 +------------------------------------
 |framework| GHCi rpm   | compiled rpm
 +---------+------------+-------------
 |snap     | 8000       | 150
 +---------+------------+-------------
 |yesod    | 6000       | 2500
 +---------+------------+-------------
 |scotty   | 22000      | 9500
 +---------+------------+-------------
 |servant  | 17000      | 8500
 +---------+------------+-------------
 |spock    | 3300       | 2700
 +---------+------------+-------------
 }}}

 > I know that these numbers do not reflect on these frameworks speed,
 since they are not well tuned or optimized, but my question is why are
 these frameworks performing better when launched from GHCi. Am I doing
 something wrong ?
 >
 > in order to build them I simply run stack build


 The benchmarks are from https://github.com/miladz68/haskell-webframework-
 comparison

 This ticket is to verify and investigate these claims.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14256>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list