Changes between Version 31 and Version 32 of PacketEncoding
- Timestamp:
- 01/12/17 11:38:27 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PacketEncoding
v31 v32 18 18 * one byte for protocol flags (stream encoder used, encryption, etc) 19 19 * one byte for compression level hint (0 for uncompressed) 20 * one byte for the chunk index (0 for main chunk)20 * one byte for the chunk index (0 for the main chunk) 21 21 * one long (4 bytes) for the size of the data that follows 22 22 23 23 [[BR]] 24 24 The main chunk containing the message uses index 0 and it is encoded (see bencode / rencode below). 25 25 26 The main message consists of a list of values, the first item is the packet type (see [/wiki/NetworkProtocol]). 27 26 28 The other chunks replace the item found at the specified index in the main chunk. (which should be empty) 29 The main chunk always comes last. 27 30 [[BR]] 28 31 … … 32 35 == Bencode vs Rencode == 33 36 The main chunk is encoded using one of those stream encoders: 34 * The old [/browser/xpra/trunk/src/xpra/net/bencode.py bencode] mode (see [http://en.wikipedia.org/wiki/Bencode Bencode on wikipedia]): a modified bencoder which supports non string keys in dictionaries, non ordered keys, and support for unicode 37 * The old [/browser/xpra/trunk/src/xpra/net/bencode.py bencode] mode (see [http://en.wikipedia.org/wiki/Bencode Bencode on wikipedia]): a modified bencoder which supports non string keys in dictionaries, non ordered keys, and support for unicode values 35 38 * The newer/faster [/browser/xpra/trunk/src/rencode rencode] mode, based on [https://code.google.com/p/rencode/ this version] with minor tweaks/fixes (packaging info: #683) 36 39 * YAML (see r6934) which is much slower, but more widely available 37 40 [[BR]] 38 41 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, which is roughly twice as fast as the pure Python version and does make a difference to the overall performance of the system: [http://xpra.org/stats/bencode/ Cython vs Python bencoder], but rencode is 3 times faster than that still !42 We also include a faster bencoder implemented in Cython, which is roughly twice as fast as the pure Python version and does make a difference to the overall performance of the system: [http://xpra.org/stats/bencode/ Cython vs Python bencoder], but rencode is 3 times faster than that still. 40 43 41 44 The python client and server can specify which packet encoders should be enabled using the switch {{{--packet-encoders=}}} (or via the config file). … … 47 50 == Pixels and Icons == 48 51 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.52 '''Note''': all window pixels, icons and cursors are usually 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. 50 53 51 54 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). … … 55 58 {{{#!div class="box" 56 59 == Compression == 57 There are up to 3 compressors supported:58 * [http://www.zlib.net/ zlib] - which is always available 60 There are up to 3 types of compressors supported: 61 * [http://www.zlib.net/ zlib] - which is always available but very inefficient 59 62 * [https://code.google.com/p/lz4/ lz4] - available on most systems, used by default if present (more information here: #443) 60 63 * [http://www.oberhumer.com/opensource/lzo/ lzo] (version 0.14.0 onwards): not as efficient as lz4, but still much faster than zlib. 61 64 62 In version 0.14.0, you can select which compressors are enabled using the {{{--compressors=}}} switch (or the configurationfile).65 You can select which compressors are enabled using the {{{--compressors=}}} switch (or the equivalent entry in the [/wiki/Configuration configuration] file). 63 66 64 67 [[BR]]