Ticket #3582 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

Compiling with optimizations on hurts performance

Reported by: gchrupala Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.10.4
Keywords: optimization Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

The attached program runs many times slower when compiled with optimizations (4.5 seconds vs. 1.5 minutes on my machine).

I wasn't able to reduce the program to a small snippet so I attach the whole thing (including data files to process).

I compiled and ran like this:

ghc --make test2.hs time ./test2

And then

ghc --make test2 -fforce-recomp -O time ./test2

Attachments

bug-ghc.tar.bz2 Download (195.4 KB) - added by gchrupala 2 years ago.
Program which can be run to reproduce bug

Change History

Changed 2 years ago by gchrupala

Program which can be run to reproduce bug

Changed 2 years ago by igloo

  • status changed from new to closed
  • difficulty set to Unknown
  • resolution set to fixed

Thanks for the report. I can reproduce this with 6.10.4, but not the HEAD or 6.12, so it looks like it's already fixed.

Without optimisation:

./test2  7.22s user 0.12s system 99% cpu 7.375 total

With optimisation:

./test2  5.61s user 0.12s system 99% cpu 5.761 total

Changed 2 years ago by simonpj

Good! And, just to check, are both faster than the corresponding 6.10.4 figures?

Simon

Changed 2 years ago by igloo

Non-optimised 6.10.4 is:

./test2  6.90s user 0.05s system 99% cpu 6.957 total

Changed 2 years ago by simonpj

Interesting. So non-optimised is slower in 6.12. But optimised is faster in 6.12.

OK, I guess that's enough for this bug. gchrupala, please let us know if you encounter this kind of thing again

Simon

Note: See TracTickets for help on using tickets.