Re: [PATCH 1/2] lzma support: decompression lib, initrd support

From: Christian Leber
Date: Tue Jun 14 2005 - 07:55:48 EST


On Tue, Jun 14, 2005 at 01:39:15PM +0100, Paulo Marques wrote:
> >[...]
> >>+ for (pb = 0; prop0 >= (9 * 5); pb++, prop0 -= (9 * 5));
> >>+ for (lp = 0; prop0 >= 9; lp++, prop0 -= 9);
> >
> >Put the ";" on a line of its own.
> >
> >I'd have thought the above could be done arithmetically?
>
> I just tried a small test program to see the speed/code size difference
> to this code, which is the arithmetic equivalent:
>
> pb = prop0 / (9 * 5);
> prop0 %= (9 * 5);
> lp = prop0 / 9;
> prop0 %= 9;
>
> This code runs a lot faster than the original. This is not very
> important since it runs only once AFAICT.

Was allready fixed in the newer version.
But i doubt that this _few_ cycles matter in any way.

The odd thing is, that the orginal lzma author has both version in the
lastest version of his sdk, but commented out the arithmetic version ?!?

> As for the code size, it is smaller if compiled with -Os, but larger
> when compiled with -O2 or -O3.

-O3 helps a lot for the actual decompression


Christian Leber

--
http://www.nosoftwarepatents.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/