libreoffice-online/loleaflet/js
Ashod Nakashian ddc85b24f9 leaflet: smart throttling of RichProxy polling
When there is no data coming in from WSD, we slow
down the frequency of invoking RichProxy.

Supports recovering from errors and server restarts
or document unloading (i.e. when the session is
invalid).

We don't invoke RichProxy more than 40 times a second
(i.e. with 25ms interval) and we slow down when
the last data was received 3x longer than the
polling interval. The current decay rate is 15%.
That is, we throttle to 1.15x the last interval.
This brings us down from 25ms to 500ms in about
4 seconds, which is very reasonable.

However, when we want to send data, or when we do
receive any data, we immediately maximize the
frequency so we can communicate as fast as possible
and reduce the user-visible latency. Notice that
when we get some data (without having sent anything
recently) it implies activity from another user,
so we do want to get their changes in real-time.
This is why we reduce the polling frequency
gradually, but increase it abruptly.

The parameters of the algorithm are configurable
directly in the code, but the current defaults are
very reasonable.

Change-Id: I0b9fd6db73caa35853fe6d8077bef66934de679c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94654
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-05-22 17:50:15 +02:00
..
Autolinker.js loleaflet: import Autolinker.js library 2020-02-21 00:49:04 +01:00
global.js leaflet: smart throttling of RichProxy polling 2020-05-22 17:50:15 +02:00
jquery.mCustomScrollbar.js mCustomScrollbar: add event listener to pointer or touch events 2019-11-16 19:28:31 +01:00
json2.js loleaflet: import json2.js library 2020-02-20 18:32:48 +01:00
l10n.js loleaflet: import l10n.js library 2020-02-19 17:32:10 +01:00
sanitize-url.js loleaflet: import sanitize-url.js library 2020-02-20 13:20:44 +01:00
select2.js typo fixes in comments and code 2020-04-26 23:19:52 +02:00
vex.combined.js typo fixes in comments and code 2020-04-26 23:19:52 +02:00
w2ui-1.5.rc1.js typo fixes in comments and code 2020-04-26 23:19:52 +02:00