-
Notifications
You must be signed in to change notification settings - Fork 54
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
Improving transfer speed #42
Comments
Dear T-vK, thanks for your recommendations.
br, Andi |
…t match linebreaks (slow transfer speed because of short chunks) #42
the issue with the chunk size should be fixed with the following regex: var chunks = content.match(/[\s\S]{1,232}/g) || []; |
Well, my idea was:
I think it's been a while since I have updated nodemcu-tool, so I might not have the base64 encoding. Changing the UART protocol to not invoke the cli is probably not possible, right? Oh and I was wrong about the |
i know your idea..but it causes to much overhead within the transfer helper function and will currently break the nodemcu tool. please take a look at the latest NodeMCU tool version including base64 encoding (requires the encode firmware modules] |
did you tried base64 based transfer yet ? in case it meet your demands i will close this issue |
What can we do to increase the transfer speed? I tried using baudrates of up to 460800, but it doesn't really seem to make a big difference compared to 115200. I mean it might be a little bit faster, but definitely not 4x as fast, at least for me. So I started digging in the source code a little and found some things that could (potentially?) be improved.
/.{1,232}/g
creates a new chunk for every single line (unless it is longer than 232 chars then it splits the same line into even more chunks).Is there a good reason to do this? Why don't we just use
/.{1,232}/gs
instead so that we match over multiple lines, making every chunk as big as possible? Are new line characters a problem or can we just escape them? And btw is there a reason for why you choose 232 in the first place?__nmtwrite
. Every time we send a chunk, we introduce overhead because of the function name of__nmtwrite
. Wouldn't it make sense to choose something shorter? Maybe a dynamic name that is chosen based on what is available. For instance if the variable name_
is not in use yet, we could simply use that.If you are transferring files that have 5000 lines of code in them then you would really save a lot of bandwidth. I mean for 5000 chunks you would introduce
5000*12=60000bytes
of overhead. if the function name was only one char_()
then you'd only have5000*3=15000bytes
of overhead.Any ideas what else could be done? Maybe a lightweight compressing/decompressing mechanism?
The text was updated successfully, but these errors were encountered: