examples: add https_speedtest example - #6134
Conversation
An example that loops a 4M upload/download cycle against a local server, for testing HTTP(S) throughput. Uses httpbin-go as the local server.
|
Forgot to mention: this won't build until the version of the digest crates in mbedtls-rs is bumped to 0.11, as the traits are incompatible between esp-hal main & the released mbedtls-rs. I quickly this locally and used a crates.io patch, but did not want to commit that hack here since I assume someone will bump mbedtls-rs soon (I'll make an issue) |
|
Thank you for the pull request! I think it might be better to amend or supplement our current QA test speed benchmark, see https://github.com/esp-rs/esp-hal/blob/main/qa-test/src/bin/embassy_wifi_bench.rs. We already have a host side for testing purposes: https://github.com/esp-rs/esp-hal/tree/main/extras/bench-server. |
|
Ah I had totally missed that example existed, sorry! So, add TLS to embassy_wifi_bench & the corresponding server? Or, should we use the httpbin-go still, to avoid implementing that wheel? Do these qa tests generally only run on *nix, or should these be cross platform? |
|
I would like to keep running the bench server on windows, please. |
They need to be cross platform, I suggest a new qa test targeting the same bench server (different port ofc, bench server will need some updates here). |
|
We've restored digest 0.10 compatibility (in addition to 0.11) so mbedtls-rs should be a viable target again. |
Submission Checklist 📝
cargo xtask fmt-packagescommand to ensure that all changed code is formatted correctly.skip-changelogormanual-changeloglabel as appropriate.Extra:
Pull Request Details 📖
An example that loops a 4M upload/download cycle against a local server, for testing HTTP(S) throughput. It uses httpbin-go as the local server, talking over the LAN only to avoid internet speed from affecting results. I personally get about 3Mbit up/down with TLS and about 12Mbit with plain http.
This currently uses e-tls not mbedtls-rs, because the transfer rate is (unexpectedly) 100x slower with mbedtls. I plan to add a cargo feature to swtich between these to make that easier to check, once I've established that it's not just me misusing mbedtls.Mea culpa, mbedtls enabled againIt also currently only builds for S3, because that's all I have. I can't see why similarly shaped devices wouldn't work but will let someone who has access to them test & enable this on those devices so I don't break HIL tests/ci/whatever.
For disclosure: I used an LLM to rip the guts of this out of our firmware and make it talk to httpbin, so there could still a bit of LLM waffle and verbosity I missed while reviewing the code