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

Support more than one write/read at a time (improve performance) #12

Closed
AaronO opened this issue Sep 18, 2013 · 6 comments
Closed

Support more than one write/read at a time (improve performance) #12

AaronO opened this issue Sep 18, 2013 · 6 comments
Milestone

Comments

@AaronO
Copy link
Collaborator

AaronO commented Sep 18, 2013

Right now since we toggle readable/writable everytime to synchronize reads/writes, I suspect that's damaging the performance of socket-io.stream.

Would be great if we could do something smarter rather than simply toggling. I think it would dramatically improve performance.

@nkzawa
Copy link
Owner

nkzawa commented Sep 20, 2013

+1

I'm also sure that we can do better for performance.

@AaronO
Copy link
Collaborator Author

AaronO commented Sep 30, 2013

Do you have any good thoughts on this ?

I'm really busy lately (with business) unfortunately :/

I've tried out a few things in the https://github.com/nkzawa/socket.io-stream/tree/fix/performance-issues branch.

Feel free to check it out.

Right now I feel that socket.io-stream is only doing one read/write at a time, and you can really feel it the end user experience, which kind of makes it suck a little.

This is a massive issue, that would dramatically improve the library if we can solve it.

So lets get it fixed ! :)

@nkzawa
Copy link
Owner

nkzawa commented Sep 30, 2013

I'm also busy recently because I'm taking a vacation and am traveling :)
I'll check the detail when I went back.

Anyway, it's better to take benchmark test first, IMO.

@dotnetwise
Copy link

so you back from vacation?

@nkzawa
Copy link
Owner

nkzawa commented Apr 5, 2014

I will check #13 again.

@nkzawa
Copy link
Owner

nkzawa commented Apr 5, 2014

I noticed that writing multiple times at a time makes the module incompatible to Stream API.
A different approach is to send a bigger chunk at a time by using the highWaterMark option.

BTW on upcoming socket.io v1.0, we can directly send a number of binary data at once.
I think we can improve performance then.

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

No branches or pull requests

3 participants