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

Use binary data instead of string/object data #5

Open
huytd opened this issue May 23, 2015 · 12 comments
Open

Use binary data instead of string/object data #5

huytd opened this issue May 23, 2015 · 12 comments

Comments

@huytd
Copy link
Collaborator

huytd commented May 23, 2015

To speed up the connection. Send/receive data in binary format is a better idea than string/object.

@huytd huytd changed the title Use binary data instead of string data Use binary data instead of string/object data May 23, 2015
@uncedric
Copy link

how would you implement that? could you point us to one example?

@chrisevans1001
Copy link

@huytd
Copy link
Collaborator Author

huytd commented May 24, 2015

honestly, I have no idea how to do it. haha. that's why I put it here but not assigned to myself yet.
thanks @chrisevans1001 for the hint. I will take a look at this one.

@krtr
Copy link
Contributor

krtr commented May 25, 2015

Socket.io in current version can send binary data just like json

http://socket.io/blog/introducing-socket-io-1-0/#binary-support

@huytd
Copy link
Collaborator Author

huytd commented May 26, 2015

great!!!! 👍

@huytd
Copy link
Collaborator Author

huytd commented May 31, 2015

There is a feedback on HackerNews, he compared the amount of data transfer by the original AgarIO game and our clone. Here is the details:
https://news.ycombinator.com/item?id=9633252

Original Agar:

  • Compressed binary data
  • Max packets size: 187 bytes

Our clone:

  • JSON objects/String
  • Packets size: 4253 bytes

There is a very long way ahead to optimize the server. First is the binary data, then, may be we will find a way to reduce packets size (only send changed values, etc)

@Azeranth
Copy link

Azeranth commented Jun 4, 2015

Perhaps we could have the user compress to a BLOB format and then once it is in a BLOB the server could handle it as BLOB will move easier

@Azeranth
Copy link

Azeranth commented Jun 4, 2015

If the user does the BLOB then we are utilizing some of the user resources not taxing the program

@giongto35
Copy link
Contributor

Super interesting !!! thank you

@huytd
Copy link
Collaborator Author

huytd commented Jul 29, 2015

Found an interested article about Binary in JS
http://danthedev.com/2015/07/25/binary-in-javascript/

@huytd
Copy link
Collaborator Author

huytd commented Jul 30, 2015

Somebody has done a serious research on Agar.io data structure
https://github.com/Eureka22/Agar.io-Protocol/blob/master/Protocol.md

@igorantun
Copy link
Collaborator

@huytd That Protocol.md is pretty interesting!

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

7 participants