Changes between Version 25 and Version 26 of PacketEncoding
- Timestamp:
- 07/28/14 15:11:28 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PacketEncoding
v25 v26 37 37 [[BR]] 38 38 This 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] 39 We also include a faster bencoder implemented in Cython: [http://xpra.org/stats/bencode/ Cython vs Python bencoder]. 40 41 The python client and server can specify which packet encoders should be enabled using the switch {{{--packet-encoders=}}} (or via the config file). 42 For backwards compatibility, you should always enable {{{bencode}}} as this is the encoding used by default for connecting. 40 43 }}} 41 44 … … 46 49 '''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. 47 50 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).51 The 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). 49 52 }}} 50 53 … … 52 55 {{{#!div class="box" 53 56 == Compression == 57 There 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 62 In version 0.14.0, you can select which compressors are enabled using the {{{--compressors=}}} switch (or the configuration file). 63 64 [[BR]] 65 54 66 The compression level can be specified via the command line ("{{{-z LEVEL}}}" or "{{{--compress=LEVEL}}}"). 55 67 56 68 Here is what the {{{LEVEL}}} does: 57 69 * {{{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 effort59 * 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 important70 * {{{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 60 72 }}} 61 73 … … 63 75 {{{#!div class="box" 64 76 == 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]]68 77 There 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! 69 78 [[BR]] … … 84 93 == Configuration == 85 94 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..).95 The default settings should end up using {{{lz4}}} and {{{rencode}}}, since those are by far the best options. 87 96 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: 97 The {{{zlib}}} and {{{bencode}}} options will remain for compatibility with clients which do not have support for them (ie: {{{Android}}}, html5..). 98 99 You can also change the current encoder/compressor at runtime: 95 100 * switch to zlib: {{{xpra control :DISPLAY compression zlib}}} 96 101 * switch to lz4: {{{xpra control :DISPLAY compression lz4}}} 102 * switch to lz0: {{{xpra control :DISPLAY compression lz0}}} 97 103 * switch to bencode: {{{xpra control :DISPLAY encoder bencode}}} 98 104 * switch to rencode: {{{xpra control :DISPLAY encoder rencode}}} 105 * switch to yaml: {{{xpra control :DISPLAY encoder yaml}}} 99 106 More info on {{{xpra control}}} here: #461. 100 107 You can view the current connection options with: