-
Notifications
You must be signed in to change notification settings - Fork 18k
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
AP_HAL: Improve speed param download in network links (sitl/linux) #25357
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wowzers! Nice catch. This effects non-ChibiOS and non-MAVFTP param downloads. That's a big deal. This is probably a good one for 4.4.3!
The change implies a EDIT: To be clear, I do want SITL to be faster on this, it's been killing me recently! |
oh, right! It's bandwidth in bytes so 57.6Kbit BYTE equivalent, minus start bit and a gap, is 57.6k/10 = 5760 BYTES per second. |
But yes, I do see that 57600 baud means 5.7kbps So the linked pr should mean we use 30% of the bw at most for params? |
I'm not as sure about that. I do know our math for param bandwidth usage is low. Everytime I download params I see a large reduction in radio throughput. The same isn't true for the FTP interface, but if you are using the old param interface it's very bad. I'd pretty happily take anything that allocates a larger percentage of bandwidth to params during the download. |
ba19d05
to
01c68eb
Compare
01c68eb
to
4bdd3ae
Compare
The current patch worked well here on SITL and Linux. test in SITL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! The code is better in the C file like this but it breaks the pattern from the other AP_HAL implementations. I'm neutral about it. Change it if you want, I'm happy to merge as-is
This has the potential to speed up CI but I don't notice any significant difference. |
This PR inspired me to make PR #25365 |
The reason for this PR makes me think we should change bw_in_bytes_per_second() to be a pure virtual (aka must be implemented by the driver) |
// if connected, assume at least a 10/100Mbps connection | ||
const uint32_t bitrate = (_connected && _ip != nullptr) ? 10E6 : _baudrate; | ||
return bitrate/10; // convert bits to bytes minus overhead | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a missing newline, otherwise the pre-commit stuff will start to fail again.
This improves parameter loading speed with SITL and Linux. After the linked patch, parameter loading speed (not using mavftp) got ~10x slower.
There is no reason for assuming that these are limited to 57600 baud.
In my tests:
param fetch in master with QGC takes ~30 seconds
with this patch (thanks @magicrub), it takes ~2s
Linux shows similar results
Apparently it was a typo in here:866db28#diff-da049e0cf2dd85cd33145ab82688554b96b56444b22e5475a1d961e259aa69d9L136