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

Improving the logging performance of esp-println with async TX #1843

Closed
ProfFan opened this issue Jul 22, 2024 · 2 comments
Closed

Improving the logging performance of esp-println with async TX #1843

ProfFan opened this issue Jul 22, 2024 · 2 comments
Labels
package:esp-println Issues related to the esp-println package

Comments

@ProfFan
Copy link
Contributor

ProfFan commented Jul 22, 2024

The current implementation of esp-println is blocking (which is totally reasonable) but the performance is not great as it blocks everything else in a critical region.

In my project I designed an async version that TX in a separate embassy task. This improves the performance of logging 10x at least, and allows esp-wifi with TRACE enabled to run fast. The cost however is 0.5-2KB of a ring buffer that depends on your message size (with defmt this can be very small).

I am thinking about porting this to esp-println. However currently this only works with embassy so I need suggestions on how to achieve this without it.

My implementation uses a custom halt function in esp-backtrace to ensure that the panic message is flushed to the USB serial JTAG in case of even catastrophic failure.

My implementation lives in https://github.com/ProfFan/magic-loc-ng/blob/7280f7e4a6b0062bf56595aa8017f035fbcd316c/src/serial/mod.rs

@bjoernQ
Copy link
Contributor

bjoernQ commented Jul 23, 2024

This sounds like a great thing for a 3rd party component I guess

@bjoernQ bjoernQ added the package:esp-println Issues related to the esp-println package label Jul 23, 2024
@MabezDev
Copy link
Member

This is very cool! I think that we want to keep esp-println and friends as simple as possible though. As @bjoernQ mentioned, this would be great as a 3rd party alternative.

@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:esp-println Issues related to the esp-println package
Projects
Archived in project
Development

No branches or pull requests

3 participants