-
Notifications
You must be signed in to change notification settings - Fork 73
autoupdater: update download progress display less frequently #274
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
base: main
Are you sure you want to change the base?
Conversation
Updating the "XXXXX / XXXXX KiB" display for every run of recv_image_cb() is a significant bottleneck on slow consoles. This was reported for a device using a 9600 Baud serial console, but the slowdown is noticeable even on a 115200 Baud console, especially when the network is fast. Replace the output with a "XX.X / XX.X MiB" display and only update it every 0.1 MiB to fix the issue. Closes freifunk-gluon#273
@neocturne @kpanic23 what about this, has this been tested already? |
I have tested it on one of my devices with a 115200 Baud UART, but it would be great to hear how well it works at 9600 Baud. |
I have an Aerohive ap121 here and could test this patch |
@Djfe that statement might be true for many, including me, but it doesn't matter at all until someone really does it :-P |
Had a look at this code, so that would likely speed things up for @kpanic23 100x, from 20min for 44MiB = 0.30 MBit/s to 30MBit/s. Of course still potentially a bottleneck. But this change is straightforward and I like the simplicity of it, especially for something important like the autoupdater. Therefore looks good to me. |
44MiB are probably a typo, and the image is actually 4 or 4.4MiB? With the new code we should achieve ~1.92MiB/s when logging over a 9600 Baud 8N1 UART (9600 bits per second / 10 bits per character / 50 characters per message / 10 messages per MiB). Which still seems reasonable for our typical image sizes. The bottleneck could be avoided completely if we logged only once per fixed time interval instead of making it depend on the amount of transferred data... unsure if that is worth complicating the code. |
@T-X Would you still say the solution is good enough with the numbers I provided? |
So for an 8 MiB image at a 9600 baud console (worst case) output would need |
no typo, see #273 |
Updating the "XXXXX / XXXXX KiB" display for every run of recv_image_cb() is a significant bottleneck on slow consoles. This was reported for a device using a 9600 Baud serial console, but the slowdown is noticeable even on a 115200 Baud console, especially when the network is fast.
Replace the output with a "XX.X / XX.X MiB" display and only update it every 0.1 MiB to fix the issue.
Closes #273