[Tremor] Tremor code optimisations [fwd]

Dave Taylor ddt
Tue Jun 15 13:37:21 PDT 2004


<F10E8F38-BEBE-11D8-A7F9-000A95A4DC02 at kernel.crashing.org>
Message-ID: <20040615203721.GB10446 at perilith.com>

I think Michael made the diff, but stick with the original bitwise.c,
and you should still see a large improvement.  The oggpack_look() fn
used to be 4% of the profile.  It's down to about 1.5%.

The codebook patch has the good stuff.  Dramatic improvement in both
speed and footprint.  I pulled every loop-invariant calculation and
every structure pointer derefernce out of the main loop so that gcc might
have an easier time of it and so that the asm would be easier to write,
if you're feeling so inclined.

=-ddt->

On Tue, Jun 15, 2004 at 01:27:10PM +0200, Segher Boessenkool wrote:
> >Dave Taylor asked me to forward this on to the list. It's a patch
> >against
> >Tremor-lowmem, and increases performance by around 10% (obviously,
> >this'll be
> >platform dependant), while cleaning up the code a little.
>
> The bitwise.diff change creates incorrect C code (aliasing
> problem); furthermore, it is very likely a performance loss
> on most (modern) architectures (didn't actually test, though).
>
> These routines are excellent candidates to code in assembler
> for your target platform, if you are going to do machine-
> specific micro-optimizations anyway...  GCC tends not to
> be too smart on this kind of code (not as smart as a human
> programmer that can do all kinds of interesting bit-fiddling
> tricks, that is).
>
> Didn't look at the other patch, sorry.
>
>
> Segher
>


More information about the Tremor mailing list