Library-vs-local performance

2008-06-24 Thread Scott Dillard
Hi, I've got a library that I'm in the process of uploading to hackage (waiting for account) but the darcs repo is here: http://graphics.cs.ucdavis.edu/~sdillard/Vec I notice a slight drop in performance when I install the library using cabal. Maybe 10-20%, on one particular function. This is

Re: Library-vs-local performance

2008-06-24 Thread Don Stewart
dons: sedillard: Hi, I've got a library that I'm in the process of uploading to hackage (waiting for account) but the darcs repo is here: [1]http://graphics.cs.ucdavis.edu/~sdillard/Vec I notice a slight drop in performance when I install the library using

Re: Library-vs-local performance

2008-06-24 Thread Scott Dillard
That said, it's entirely possible to program libraries in a way to specifically allow full inlining of the libraries. The Data.Binary and Data.Array.Vector libraries are written in this style for example, which means lots of {-# INLINE #-} pragmas, maximum unfolding and high optimisation

Re: Library-vs-local performance

2008-06-24 Thread Don Stewart
sedillard: That said, it's entirely possible to program libraries in a way to specifically allow full inlining of the libraries. The Data.Binary and Data.Array.Vector libraries are written in this style for example, which means lots of {-# INLINE #-} pragmas, maximum

Re: Library-vs-local performance

2008-06-24 Thread Ian Lynagh
On Tue, Jun 24, 2008 at 02:01:58PM -0700, Donald Bruce Stewart wrote: 1) Library is installed via cabal. 2) Library source lives in the same directory as the application, so that ghc --make Examples.hs also builds the library. That's compiling Examples with full access to the

Re: Library-vs-local performance

2008-06-24 Thread Scott Dillard
I can't reproduce the behavior on any of the less egregiously inlined functions. For everything else the running times are the same using either local packages or installed libraries. On Tue, Jun 24, 2008 at 3:16 PM, Ian Lynagh [EMAIL PROTECTED] wrote: On Tue, Jun 24, 2008 at 02:01:58PM -0700,

Re: Library-vs-local performance

2008-06-24 Thread Don Stewart
sedillard: I can't reproduce the behavior on any of the less egregiously inlined functions. For everything else the running times are the same using either local packages or installed libraries. On Tue, Jun 24, 2008 at 3:16 PM, Ian Lynagh [EMAIL PROTECTED] wrote: On Tue,

Re: Library-vs-local performance

2008-06-24 Thread Scott Dillard
On Tue, Jun 24, 2008 at 3:51 PM, Don Stewart [EMAIL PROTECTED] wrote: I've taken all optimization flags out of the .cabal file. They don't have any effect. My understanding of things is this: (please correct if wrong) All functions have inline pragmas, and all are small (1 or 2

Re: Library-vs-local performance

2008-06-24 Thread Don Stewart
sedillard: On Tue, Jun 24, 2008 at 3:51 PM, Don Stewart [EMAIL PROTECTED] wrote: I've taken all optimization flags out of the .cabal file. They don't have any effect. My understanding of things is this: (please correct if wrong) All functions

Re: Library-vs-local performance

2008-06-24 Thread Scott Dillard
On Tue, Jun 24, 2008 at 4:15 PM, Don Stewart [EMAIL PROTECTED] wrote: Nope, there's a lot of optimisations taking place on the core-to-core phase, to ensure the core that gets unfolded into your .hi files is as nice as possible. And then still there's things that actually stay as calls into