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

Increase network buffer size #556

Closed
gfwilliams opened this issue Aug 3, 2015 · 5 comments
Closed

Increase network buffer size #556

gfwilliams opened this issue Aug 3, 2015 · 5 comments

Comments

@gfwilliams
Copy link
Member

See http://forum.espruino.com/conversations/272025/

This is currently 64, but could hopefully be much bigger. Perhaps for sending we could even use aalloc to allocate just what we need.

Only thing to beware of is unless the CC3000 build gets massive static buffers put in too, it'll crash when we try and send more than 64 bytes (so should probably limit the max size in that case).

@nkolban
Copy link
Contributor

nkolban commented Oct 8, 2015

As discussed in the forum thread, sending data in 64 byte chunks is as thought slow. On the ESP8266 board, it is quite noticable.

@gfwilliams
Copy link
Member Author

... although on ESP8266 you're allocating separate buffers - so for instance if we moved to 1500 bytes, that's presumably 3kB of RAM that you've now had to use up, which drastically reduces the amount of JS variables you can safely have.

@nkolban
Copy link
Contributor

nkolban commented Oct 8, 2015

I'm assuming that when net_<board>_send() is called then a buffer of data is passed in (say 1500 bytes). Since this is stack allocated, ESP8266 duplicates it creating 3000 bytes in total. However, almost immediately net_<board>_send() returns and the initial 1500 bytes of stack is released resulting in the necessary 1500 bytes being held for transmission. Subsequent requests to send are immediately told "not yet" through a return code of 0 indicating that no consumption is possible just now.

What about making the buffer size a runtime configurable system property and allow the user to decide?

@gfwilliams
Copy link
Member Author

Just a note here, it seems the ESP8266 build has a max packet size of 544 bytes, so that is all we have to care about.

Some discussion here: http://forum.espruino.com/conversations/278181/#comment12649305

@gfwilliams
Copy link
Member Author

Already fixed: 34326d0

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

2 participants