LZMA is compression algorithm used in popular 7-zip archiver. There currently exists 3 different implementations:
The first two implementations are available from the 7-zip homepage. The Java version is available from the p7zip download area. I was interested in comparing speed of those implementations and here are the results. The file used for testing was the same I used for my archivers comparison.
| Seconds | Times slower than C++ implementation | Language | LZMA SDK Version | Archive size (bytes) |
|---|---|---|---|---|
| 54.298 | 1× | C++ | LZMA SDK 4.23 | 2797427 |
| 122.877 | 2.263× | C# (MS .NET 1.1.4322) | LZMA# SDK 4.23 | 2797427 |
| 114.956 | 2.117× | Java (Sun Java HotSpot Client VM build 1.5.0-b64, mixed mode, sharing) | LZMA_JAVA SDK 4.12 beta | 2795665 |
| 164.847 | 3.036× | GCJ 3.4.4 (mingw special) | LZMA_JAVA SDK 4.12 beta | 2795665 |
| 150.086 | 2.764× | GCJ 3.4.4 (mingw special) -fno-bounds-check -fno-store-check | LZMA_JAVA SDK 4.12 beta | 2795665 |
I was really surprised that Java beated .NET.
I have no idea why the file created with Java versions is smaller.
The speed of Java/C# in comparison with C++ is really good.
Times measured with Timer 3.01.
Chart created in TeeChart Office.
Comment by Michal Molhanec on 2007-09-28 18:06:26 .
Re: python comparison
I don't know about any pure Python LZMA implementation (PyLZMA is just a wrapper). If you know any, please provide a link.
Comment by Michal Molhanec on 2007-09-28 18:04:51 .
Re: testing source code?
The source code is available at 7-zip and p7zip SourceForge site (see introduction text for links), I have not written any testing source code myself.
Comment by Jason on 2007-09-28 17:34:27 .
python comparison
It would be nice to know how the python one compared against Java and C#
Comment by roy ashbrook on 2007-07-10 11:41:26 .
testing source code?
could you post your testing source code?