novnc / noVNC

VNC client web application
https://novnc.com
Other
11.17k stars 2.24k forks source link

support web worker? #114

Open JianMeng opened 12 years ago

JianMeng commented 12 years ago

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.

kanaka commented 12 years ago

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:

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 commented 11 years ago

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

EvanDotPro commented 9 years ago

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

kosmasgiannis commented 9 years ago

@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.

EvanDotPro commented 9 years ago

@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. :)

DirectXMan12 commented 9 years ago

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

symbalis commented 7 months ago

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.