darcs

Issue 1697 Remove -O2 from darcs.cabal?

Title Remove -O2 from darcs.cabal?
Priority wishlist Status wont-fix
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, gwern, kowey, twb
Assigned To
Topics Performance

Created on 2009-11-16.03:10:09 by twb, last changed 2017-07-30.23:40:28 by gh.

Messages
msg9384 (view) Author: twb Date: 2009-11-16.03:10:04
Is there a real need for -O2 in darcs.cabal?  By putting it there, -O0
can't be used without manually editing the .cabal file, which is a
major pain in the arse.

AIUI cabal uses -O2 by default anyway, cf. --enable-optimization
vs. --disable-optimization.

The issue arises because my buildbot, siva, has "only" 512MB of RAM
and I am investigating ways to avoid ghc being OOM-killed.
msg9385 (view) Author: gwern Date: 2009-11-16.04:53:31
cabal install --help:

 -O --enable-optimization[=n]      Build with optimization (n is 0--2, default
                                   is 1)

Cabal used to use -O2 by default, but people complained about the buildtime and
Duncan reasoned that most libraries and apps wouldn't see a major difference anyway.

Whether that is true or not for Darcs is something that needs benchmarking.
msg9473 (view) Author: kowey Date: 2009-11-24.00:45:42
OK: so when somebody has a round tuit, drop -O2 from the cabal file, build a
regular version and an -O2 version and run it through the darcs-benchmark
benchmarks?  Perhaps the unit tests as well for timing?
msg9478 (view) Author: twb Date: 2009-11-24.03:22:35
Eric Kow wrote:
> OK: so when somebody has a round tuit, drop -O2 from the cabal file,
> build a regular version and an -O2 version and run it through the
> darcs-benchmark benchmarks?  Perhaps the unit tests as well for
> timing?

Even if -O1 (the default) produces a binary that's less performant
than -O2, why is that important?  The current behaviour essentially
forces ALL users to use -O2, regardless of the Cabal defaults or user
preferences (i.e. ~/.cabal and --enable-optimization=N).
msg9487 (view) Author: kowey Date: 2009-11-24.14:00:04
On Tue, Nov 24, 2009 at 03:22:38 +0000, Trent W. Buck wrote:
> Even if -O1 (the default) produces a binary that's less performant
> than -O2, why is that important?  The current behaviour essentially
> forces ALL users to use -O2, regardless of the Cabal defaults or user
> preferences (i.e. ~/.cabal and --enable-optimization=N).

Because (I claim) users generally want a fast Darcs than a fast compiled
Darcs.

These users would be forced to explicitly pass in flag (not acceptable
because they won't do it, either by oversight or otherwise) or modify
their Cabal defaults for all packages and not just Darcs (not
acceptable, ick).  What we really want is for Darcs to supply -O2 as a
default which can then be overridden.  Simpler would be if the
performance gains were negligible, in which case we should just drop the
default.

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
History
Date User Action Args
2009-11-16 03:10:10twbcreate
2009-11-16 04:53:33gwernsetnosy: + gwern
messages: + msg9385
2009-11-24 00:45:45koweysetpriority: wishlist
status: unknown -> needs-reproduction
topic: + Performance
messages: + msg9473
nosy: + kowey
2009-11-24 03:22:38twbsetmessages: + msg9478
2009-11-24 14:00:10koweysetmessages: + msg9487
2017-07-30 23:40:28ghsetstatus: needs-reproduction -> wont-fix