[patch] Expression performance optimization

Jules Bergmann jules at codesourcery.com
Mon Jun 11 17:31:56 UTC 2007


This patch has several optimizations for expression performance.

For Scalar_blocks, it uses a new shared map for all blocks, instead of 
each block having a local Local_or_global map.  It also removes the 
storage of the Scalar_block's size.  Before these changes, the compiler 
believed that Scalar_blocks had to be stored on the stack.  This added 
significant overhead to expressions using Scalar_blocks.

For unary, binary, and ternary functions defined in fns_elementwise, it 
passes views by const reference, instead of by value.  This avoids the 
need to increment/decrement reference counts, which add significant 
overhead for small vector sizes.

For the mul binary function, it uses the op::Mult functor instead of 
creating a redundant mul_functor.  mul_functor was functionally 
equivalent, but math library evaluators (such as SAL, IPP, and builtin 
SIMD) did not recognize it.  Similar changes need to be made for other 
functions that correspond to an operator.

Currently testing.  Will post some examples of improved performance in a 
bit.

				-- Jules

-- 
Jules Bergmann
CodeSourcery
jules at codesourcery.com
(650) 331-3385 x705
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: opt.diff
URL: <http://sourcerytools.com/pipermail/vsipl++/attachments/20070611/d4114e5b/attachment.ksh>


More information about the vsipl++ mailing list