xpra icon
Bug tracker and wiki

Changes between Version 25 and Version 26 of PacketEncoding


Ignore:
Timestamp:
07/28/14 15:11:28 (6 years ago)
Author:
Antoine Martin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PacketEncoding

    v25 v26  
    3737[[BR]]
    3838This allows various languages to implement the xpra protocol, specifying which encoder they want to use (bencode is more widely available than rencode).
    39 We also include a faster bencoder implemented in Cython: [http://xpra.org/stats/bencode/ Cython vs Python bencoder]
     39We also include a faster bencoder implemented in Cython: [http://xpra.org/stats/bencode/ Cython vs Python bencoder].
     40
     41The python client and server can specify which packet encoders should be enabled using the switch {{{--packet-encoders=}}} (or via the config file).
     42For backwards compatibility, you should always enable {{{bencode}}} as this is the encoding used by default for connecting.
    4043}}}
    4144
     
    4649'''Note''': all window pixels, icons and cursors are sent in their own chunk using dedicated [/wiki/Encodings picture encodings] and bypass the stream encoder completely (for efficiency). Pixel compression is done in its own thread, to improve responsiveness.
    4750
    48 The only exception to this rule is the `RGB` encoding, which will use the stream compression on the raw pixels (it still called from the pixel compression thread).
     51The only exception to this rule is the `RGB` encoding, which will use the stream compression on the raw pixels (but it is still called from the pixel compression thread to preserve responsiveness).
    4952}}}
    5053
     
    5255{{{#!div class="box"
    5356== Compression ==
     57There are up to 3 compressors supported:
     58* [http://www.zlib.net/ zlib] - which is always available
     59* [https://code.google.com/p/lz4/ lz4] - available on most systems, used by default if present (more information here: #443)
     60* [http://www.oberhumer.com/opensource/lzo/ lzo] (version 0.14.0 onwards): not as efficient as lz4, but still much faster than zlib.
     61
     62In version 0.14.0, you can select which compressors are enabled using the {{{--compressors=}}} switch (or the configuration file).
     63
     64[[BR]]
     65
    5466The compression level can be specified via the command line ("{{{-z LEVEL}}}" or "{{{--compress=LEVEL}}}").
    5567
    5668Here is what the {{{LEVEL}}} does:
    5769* {{{0}}} means no compression at all and is useful when bandwidth is no issue but latency is
    58 * {{{1}}} is the best trade-off and will compress everything but without making too much of an effort
    59 * values of 2 and above increase the compression (CPU usage and latency will increase) and should rarely be needed - the [/wiki/Encodings picture encoding] used is much more important
     70* {{{1}}} is the best trade-off and will compress everything without spending too much time on it
     71* values of 2 and above increase the compression only slightly and should rarely be needed (CPU usage and latency will increase much more): the [/wiki/Encodings picture encoding] used is much more important
    6072}}}
    6173
     
    6375{{{#!div class="box"
    6476== lz4 vs zlib ==
    65 As of version {{{0.11.0}}}, xpra supports [https://pypi.python.org/pypi/lz4 lz4] compression and will use it instead of the default [http://docs.python.org/2/library/zlib.html zlib] when {{{LEVEL}}} is set to 1 and both ends support the compression mode. More information here: #443.
    66 There is also support for [http://www.oberhumer.com/opensource/lzo/ lzo] in version {{{0.14.0}}} onwards, it can be used as an alternative to lz4: it is also much faster than zlib but not as efficient as lz4.
    67 [[BR]]
    6877There is a [/browser/xpra/trunk/src/tests/xpra/net/lz4_vs_lzo_vs_zlib.py benchmark test] you can run to measure the performance of lz4 and lzo compared to zlib. On average, lz4 is about 10 times faster than zlib on its fastest setting for regular packets, and even faster for RGB data (up to 60 times faster than zlib!) whilst also compressing better than zlib!
    6978[[BR]]
     
    8493== Configuration ==
    8594
    86 The default settings should end up using {{{lz4}}} and {{{rencode}}}, since those are by far the best options. That's why there are no command line options to change the defaults. The {{{zlib}}} and {{{bencode}}} options will remain for compatibility with clients which do not have support for them (ie: {{{Android}}}, html5..).
     95The default settings should end up using {{{lz4}}} and {{{rencode}}}, since those are by far the best options.
    8796
    88 However, you can disable individual encoders/compressors using environment variables:
    89 {{{
    90 XPRA_USE_LZ4=0 xpra ...
    91 XPRA_USE_BENCODER=0 xpra ...
    92 XPRA_USE_RENCODER=0 xpra ...
    93 }}}
    94 With v0.11 onwards, you can also change the current encoder/compressor at runtime:
     97The {{{zlib}}} and {{{bencode}}} options will remain for compatibility with clients which do not have support for them (ie: {{{Android}}}, html5..).
     98
     99You can also change the current encoder/compressor at runtime:
    95100* switch to zlib: {{{xpra control :DISPLAY compression zlib}}}
    96101* switch to lz4: {{{xpra control :DISPLAY compression lz4}}}
     102* switch to lz0: {{{xpra control :DISPLAY compression lz0}}}
    97103* switch to bencode: {{{xpra control :DISPLAY encoder bencode}}}
    98104* switch to rencode: {{{xpra control :DISPLAY encoder rencode}}}
     105* switch to yaml: {{{xpra control :DISPLAY encoder yaml}}}
    99106More info on {{{xpra control}}} here: #461.
    100107You can view the current connection options with: