Comment 2 for bug 1653686

Revision history for this message
Michael Eischer (eischer) wrote :

The performance problems also affects Firefox (current and past versions) but not as bad as Chrome. The issue is caused by a very inefficient handling of the zlib decompression window. Upstream fixed the problem by replacing the zlib library with an efficient one.

In case updating the novnc version on Trusty or Xenial is no option, I've implemented a workaround for the performance issue on Trusty.

vnc-perffix.patch works around the performance issue by shortening the decompression window to its expected size only once it is four times bigger than expected. Which isn't too bad from a memory consumption point of view as the expected windows size is only 32k byte entries. Without the patch the zlib window is shortened after a few bytes have been added, causing a full copy just to remove a few bytes. I've also replaced to call to Array.slice with a simple loop for copying as it speedup the window copy by an order of magnitude in Chrome. (Seems like the code managed to confuse the JIT).