[Haskell-cafe] cabal sdist warns about optimization levels

Petr P petr.mvd at gmail.com
Sun Jan 13 21:27:44 CET 2013

   Hi all,

I'm working on a library for fast sorting of MArrays. The library is
primarily about speed, so I added

    ghc-options: -O2

to the cabal file. Now cabal sdist complains with:

    'ghc-options: -O2' is rarely needed. Check that it is giving a real
benefit and not just imposing longer compile times on your users.

I wonder:

(1) Is there a way how to disable the warning? As the main aim of the
library is speed, I believe -O2 is appropriate here. And since the code is
quite short, I'm quite sure the increased compile time won't be noticeable.

(2) Why does cabal complain about it at the first place? I found a
reference saying the warning is adequate:
but not saying why. Maybe for complex programs -O2 prolongs compile time
too much, but libraries are usually compiled once and used many times, so
using -O2 for them seems reasonable in many cases.

  Thanks for help,
  Petr Pudlak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130113/8ccd16f5/attachment.htm>

More information about the Haskell-Cafe mailing list