[Spice-devel] Patch to support LZ4 compression algorithm

Javier Celaya javier.celaya at flexvm.es
Wed Nov 5 03:17:48 PST 2014


Hello

My name is Javier Celaya and I work for Flexible Solutions [1]. We develop a 
virtualization product that includes a VDI module with Spice. As part of this 
module, we have included support for the LZ4 compression algorithm [2], and we 
would like to contribute it to the main project.

The LZ4 algorithm focuses on speed sacrificing compression ratio. In our tests, 
we obtained a compression ratio of x1.75~x2, while QUIC obtained ~x4. However, 
LZ4 was around 4~5 times faster than QUIC or GLZ. The objective was to 
implement a Spice client for devices with limited CPU performance, like 
smartphones or ARM set-top-boxes.

We have tried to keep things simple. Our approach consists in replacing the LZ 
algorithm with LZ4 when Spice is built with the --enable-lz4 switch. Adding it 
as a new option would also require changes in the software that uses the 
server, like QEMU. Then, each image is compressed independently. Since the LZ4 
dictionary size is quite small (64KB), there is no improvement in compressing 
all the images as a stream.

I send you three patches, for spice-common, spice and spice-gtk. The 
compression code is in spice, the decompression is in spice-common, and
spice-gtk only contains the macros needed to find liblz4 during configure.

We are open to comments and critics.
Best regards

[1] http://flexvm.es/
[2] https://code.google.com/p/lz4/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spice-common-lz4.patch
Type: text/x-patch
Size: 4095 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20141105/4f6a667c/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spice-gtk-lz4.patch
Type: text/x-patch
Size: 1476 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20141105/4f6a667c/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spice-lz4.patch
Type: text/x-patch
Size: 19357 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20141105/4f6a667c/attachment-0005.bin>


More information about the Spice-devel mailing list