noVNC icon indicating copy to clipboard operation
noVNC copied to clipboard

support web worker?

Open JianMeng opened this issue 13 years ago • 7 comments

Is there any plan to support web worker in noVNC?

Currently, noVNC run in single javascript thread which do RFB protocol analysis, UI update, and keyboard listener works. This work fine. But in a large UI refresh process, a lot picture in RFB protocol need to be analysed, then base64ed. In this time, single thread javascript may lose some input message from user, ex. mouse, keyboard input.

JianMeng avatar Dec 28 '11 08:12 JianMeng

It's on my wish list but there is no active work here.

I will gladly take patches in this area that meet the following:

  • Performance tests that show improvement on browsers with Web Worker support
  • Testing that shows no performance regressions on older browsers without Web Worker support
  • Well implemented

Also note that this would be most useful in combination with transferable typed arrays (so that there is MUCH less web worker messaging overhead) but that also implies that noVNC has support for typed arrays in the appropriate locations (and that typed arrays are more performant than regular arrays which wasn't true last year).

Transferable Objects: http://dev.w3.org/html5/spec/common-dom-interfaces.html#transferable-objects

kanaka avatar Dec 28 '11 15:12 kanaka

From an IRC discussion:

The biggest impact would be from moving the WebSocket and the protocol decoding all to a Web Worker. Unfortunately firefox can't do WebSockets in a Web Worker and it looks like it will still be a couple of months until that happens: https://bugzilla.mozilla.org/show_bug.cgi?id=504553

kanaka avatar Mar 12 '13 17:03 kanaka

FF 36 was released yesterday with support for this. :+1:

EvanDotPro avatar Feb 25 '15 18:02 EvanDotPro

@EvanDotPro I think that it will be available in FF 37 (https://developer.mozilla.org/en-US/Firefox/Releases/37)

Anyway, nightly builds of what will become FF 37 are already available.

kosmasgiannis avatar Feb 25 '15 19:02 kosmasgiannis

@kosmasgiannis Whoops — That's what I get for not double checking the release notes or subscribing to the bugzilla issue. I went ahead and fixed the MDN page that was the source my confusion. :)

EvanDotPro avatar Feb 25 '15 19:02 EvanDotPro

Having multiple zlib decompressors running at once might also be useful, as per #431

DirectXMan12 avatar Apr 07 '15 18:04 DirectXMan12

I've been playing with workerpool (https://www.npmjs.com/package/workerpool) to try parallelize the creation of images in display.js. It simplifies quite a lot the work.

symbalis avatar Nov 30 '23 08:11 symbalis