The cursor pixel data is in pre-multiplied argb format. We could encode it with a picture encoder which will be a lot more efficient than lz4/zlib. Also, if the client supports the feature, we could build up a cache of cursor pixels we have sent already and avoid re-sending those again, sending the unique ID of the cursor cache instead. (the cursor cache could be limited to a fixed number of cursor serial numbers to prevent growing too much).
Since cursor changes are fairly rare, the bandwidth savings would be very small - so this is a very low priority ticket.
adds ability to send cursors compressed with png if client supports it
As the lz4 compression tests were very interesting (see r4925 and ticket:443#comment:4), I thought I would try to compare png and lz4 compression for cursors. Using the png-cursors.patch, and starting an xterm then the "test custom cursor" test script, I found:
serial=2, pixels=<type 'str'>=9216 sent cursor as png: 745 bytes cursor compression took: 2.1439ms serial=10, pixels=<type 'str'>=16384 sent cursor as png: 346 bytes cursor compression took: 2.4788ms
serial=2, pixels=<type 'str'>=9216 sent cursor as: LevelCompressed(cursor: 549 bytes as zlib/5) cursor compression took: 1.0080ms serial=10, pixels=<type 'str'>=16384 sent cursor as: LevelCompressed(cursor: 177 bytes as zlib/5) cursor compression took: 0.9391ms
So lz4 compresses a lot better than png, and takes half the time to do it! That is just incredibly efficient. This patch will not be merged, and lz4 is likely to be used in places where we currently prefer png (after further tests).
Caching cursors could still be a win, so I am keeping this ticket opened.
adds ability to send cursors compressed with png if client supports it - records compression timing
Recent changes have brought more generic support for compression, including lz4 compression of cursors.
Compressed cursors are already so small that I don't see any point in complicating things with cursor caching.
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/471