Strange slowness when using async library with FFI callbacks
I've attached a Haskell and a C file, when compiled as such:
ghc -DSPEED_BUG=0 -threaded -O2 -main-is SpeedTest SpeedTest.hs SpeedTestC.c
You should find that with 7.4.2, 7.6.3 or a recent build of 7.8, building with
SPEED_BUG=0 produces an executable that takes more than a second to run, while building with
SPEED_BUG=1 runs very quickly. I've also attached the Core for both scenarios.