[Zlib-devel] To ASM or not to ASM?

Cosmin Truta cosmin at cs.toronto.edu
Sat Oct 4 14:29:07 EDT 2003


On Sat, 4 Oct 2003, Gilles Vollant wrote:

> We can, with a tools like testzlib (which compress, uncompress and compare)
> test the assembly version of compressor and uncompressor (ASMV and ASMINF)
> with thousand of batch (we can easyli made a test that try compress and
> cunompress all file on users hard disk)

Even though I understand the need for fast ASM code, I think I agree
with Mark on this. An officially-supported build must be made out of
officially-supported sources. This is explicitly stated in DLL_FAQ.txt,
too.

I always had a reluctance about using hand-written ASM code. Thousands
of tests is not a guarantee, because it's never guaranteed that the
possibly problematic boundary conditions are triggered by the test
cases, no matter how many they are. Think about the zlib-1.1.3
double-free bug, that existed for years and resisted against countless
uses, until 2002!

To respond to Mark: yes, besides the author (Chris Anderson), both
Gilles and I have looked inside the ASM code, to a bigger or smaller
degree of attention.

But if Mark cannot make support claims about ASMINF, then we cannot use
it in an official build. Which is not such a big loss, in my opinion,
because zlib decompression is fast enough anyways, and the speed gains
of ASMINF are likely to be belittled by I/O and other kinds of
overheads. It's not like MPEG or other heavy-weight kinds of compression
where the users have to wait for a considerable amount of time, and
where a little more speed can make a real difference.


Cosmin




More information about the Zlib-devel mailing list