Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialization should be async #131

Closed
manvalls opened this issue Dec 18, 2013 · 4 comments
Closed

Serialization should be async #131

manvalls opened this issue Dec 18, 2013 · 4 comments

Comments

@manvalls
Copy link

When large files are being prepared to be sent the execution of the serialization will block the javascript event loop, making the page unresponsive.

In addition, when using unreliable datachannels you're assuming your data may arrive unordered, thus if the user sends a 10kB file while a 50MB one is being prepared the 10kB one should be sent right away, at least when using unreliable datachannels.

I can think of two solutions to this problem:

1- Replace function calls with setTimeouts

function doSomething(data){
       if(data.length > 0xf) setTimeout(doSomethingElse,0,data);
}

2- Use web workers

Web workers are the way to go imo, as nowadays even phones have more than one core. And if a browser supports webrtc, it will already have support for web workers.

PS someone tell eric I made a sizeof function for javascript, he isn't answering my emails - nobody likes me :(

@michelle
Copy link
Member

Ha, @ericz should be answering soon :P.

@ericz
Copy link
Member

ericz commented Dec 18, 2013

NO I DO LIKE YOU.. Sorry I'm quite busy with the job these days so I'm slow
on the emails.

On Tue, Dec 17, 2013 at 11:30 PM, Michelle Bu notifications@github.comwrote:

Ha, @ericz https://github.com/ericz should be answering soon :P.


Reply to this email directly or view it on GitHubhttps://github.com//issues/131#issuecomment-30822051
.

510-691-3951
http://ericzhang.com

@manvalls
Copy link
Author

Ü happy manvalls is happy!!

Anyways, any thoughts about web workers?

I'm currently dropping socket.io in favour of peerjs @ chatiku.com, so you'll see me around here in a regular basis btw

@ghost ghost assigned ericz Dec 19, 2013
@michelle
Copy link
Member

michelle commented Jan 5, 2014

+1, but definitely would need to benchmark it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants