[vector] #20: Optimization strategy unclear (-Odph / -O2)

vector vector at projects.haskell.org
Wed May 19 10:48:08 EDT 2010

#20: Optimization strategy unclear (-Odph / -O2)
Reporter:  choener                      |        Owner:     
    Type:  defect                       |       Status:  new
Priority:  minor                        |    Milestone:  0.7
 Version:  0.6                          |   Resolution:     
Keywords:  documentation, optimization  |  
Comment (by rl):

 I forgot to mention that in the program from #18, you have to remove the
 INLINE pragmas to get valid results. This is because the functions aren't
 getting inlined anyway (GHC quite understandably sees no reason to do so)
 but since they are marked as INLINE, they aren't getting optimised,
 either. However, GHC specialises the function that is based on
 Data.Vector.Generic. The specialisation doesn't have an INLINE pragma and
 is getting optimised. The final result is that you are benchmarking a
 completely unoptimised Unboxed version vs. a fully specialised and
 optimised Generic version.

 GHC's behaviour is clearly quite confusing here but it won't change in
 6.12. It is all fixed in 6.13 which has a completely different inlining
 mechanism and optimises INLINE functions.

Ticket URL: <http://trac.haskell.org/vector/ticket/20#comment:5>
vector <http://trac.haskell.org/vector>
Package vector

More information about the vector mailing list