62125 - Web2 framework: triggerServerEvent has built in 50msec delay

In 2020R1.1, the JavaSrcript code to send an event from client back to server is:

        function triggerServerEvent(e, t, o=null) {
            if ("" == e)
                return;
            let n = new XojoAjaxMessage;
            n.controlID = e, n.eventName = t, n.data = o, queuedCommands.push(n), 
            msgQueueTimer = setTimeout(sendServerEvents, 50)
        }

The line "setTimeout(sendServerEvents, 50) " calls the function sendServerEvents() after a 50 msec delay.

50msec is about the ping time between Los Angeles and Atlanta, and is a noticeable amount - for example, fast twitch gamers pay good money to avoid delays of 5 to 10 milliseconds.

Adding this delay to every server event just slows things down. Web2 is so much faster than web 1 in most other areas, this is a shame.

Suggest it be changed to 0 or 1 msec.

Feature Request: feedback://showreport?report_id=62125

2 Likes