[Spice-devel] Patch to support LZ4 compression algorithm

Javi javier.celaya at nologin.es
Thu Nov 6 01:33:19 PST 2014


Hello

Marc-André, I added the changes you asked for. A new compression type 
SPICE_IMAGE_COMPRESS_LZ4 has been added, so that either LZ or LZ4 can be 
selected. Then, when LZ4 is selected, it will gracely fallback to LZ if:
- LZ4 support was not enabled in the server during compilation.
- The client does not support a new capablity 
SPICE_DISPLAY_CAP_LZ4_COMPRESSION.

The new capability is added to spice-protocol, so I send another patch for 
that repository.

El Miércoles, 5 de noviembre de 2014 15:11:01 Javier Celaya escribió:
> Hello
> 
> El Miércoles, 5 de noviembre de 2014 08:58:25 Marc-André Lureau escribió:
> > Hi
> > 
> > ----- Original Message -----
> > 
> > > 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.
> > 
> > Great!
> > 
> > > 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.
> > 
> > Sounds reasonable
> > 
> > > 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.
> > 
> > The patches look nice. However, I am not sure I understand why you chose
> > not to modify the protocol to declare the new image type. We also need a
> > new display capability before applying this patch, as the server needs to
> > remain compatible with older clients no matter before accepting this.
> > 
> > Would you be willing to do those changes to get your patch accepted?
> 
> Yes, I will do those changes and send the patches again.
> 
> Thanks
> 
> > thanks
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- 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/20141106/9dc8581b/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spice-lz4.patch
Type: text/x-patch
Size: 21663 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20141106/9dc8581b/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spice-gtk-lz4.patch
Type: text/x-patch
Size: 2285 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20141106/9dc8581b/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spice-protocol-lz4.patch
Type: text/x-patch
Size: 313 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20141106/9dc8581b/attachment-0007.bin>


More information about the Spice-devel mailing list