by Jim Leonar » Fri, 10 Jun 2005 05:57:50
This is my main beef with LZO. Variants wouldn't be a problem if they
were documented, but all attempts at trying to get docs for any one
variant's format was met with "look at the code". The code is a mess
with craploads of #define blocks and macros for different architectures
and optimizations. Even "minilzo", which is supposed to be the
pluggable/portable version, is just as difficult to follow! The few
answers I got to satiate my curiousity were obtained by looking at the
x86 assembler source for a decoder. :-P
I will say, though, that it was educational looking at said assembler
sources because it demonstrated that LZO is *not* the fastest
compression/decompression method possible on any x86 platform, as it is
nearly universally regarded to be. Discovering that gave me enough
drive to create my own 8088 byte-aligned compression library. While my
library achieves about 10% worse compression on average than LZO's
fastest (compression) variant, it is about 25% faster.
I do concede that LZO is most likely the fastest *portable* compression
library. As always, if you have to implement fast compression for a
particular piece of hardware, always start with the hardware's
strengths and weaknesses and build up from there. (In particular, I
designed my 8088 compression library around x86's powerful string
instructions, specifically REP STOSB and REP MOVSB. (For x86 freaks:
I didn't use MOVSW and STOSW because it hurt compression and the extra
processing to deal with odd lengths slowed things down -- and besides,
on 8088, there is no advantage (although there IS an advantage on 8086
and above).))