metajack / strophejs

The Strophe.js repository has moved to https://github.com/strophe/strophejs

Home Page:http://strophe.im/strophejs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Web Worker for I/O

primalmotion opened this issue · comments

Hey,

Do you think it would be possible to delegate all the BOSH I/O to a dedicated pool of web workers?
If yes, do you plan to add this? I quickly look on how to do something like this, and it will need to rewrite a certain amount of stuff. But do you like the idea? and does it worth the effort in term of performances?

@primalmotion: I really like your idea!
Do you have any performance experiences with it so far?

@flosse I have performance improvements in the context of Cappuccino applications (it's a relief for the UI). But there are still stabilities issues. Some stanzas are lost without any reasons (for now).

I'm not sure how big the actual benefit is going to be, but I would love to give Web Workers a try.

For a start, does anyone know how to spawn a Web Worker with an entry that is not in another script resource? This is something hard to get by with build systems that bundle up a single .js file. Perhaps something along new Worker(function() { /*…*/ });

From now, I have this almost working. It's a draft / POC and not clean, but it works

https://github.com/primalmotion/strophejs/blob/webworker-io/src/core.js

When I mean almost, it actually works, but drops some stanza.