Skip to content

Factor out efficient mp_hal_stdout_tx_strn_cooked from ports to lib/utils/stdout_helpers.c #7491

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

Merged
merged 2 commits into from
Jul 8, 2021

Conversation

dpgeorge
Copy link
Member

@dpgeorge dpgeorge commented Jul 6, 2021

This efficient implementation of mp_hal_stdout_tx_strn_cooked is repeated by a few ports (esp32, esp8266, cc3200, stm32) and needed by others (eg rp2), so just make the common version in lib/utils/stdout_helpers.c this efficient one so all ports use the same one.

This helps with #7479, to make print(data) faster on rp2.

@codecov-commenter
Copy link

Codecov Report

Merging #7491 (93ab078) into master (d934f8c) will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7491      +/-   ##
==========================================
- Coverage   98.29%   98.27%   -0.02%     
==========================================
  Files         154      154              
  Lines       19990    19988       -2     
==========================================
- Hits        19649    19644       -5     
- Misses        341      344       +3     
Impacted Files Coverage Δ
py/obj.c 95.63% <0.00%> (-0.80%) ⬇️
py/runtime.c 99.38% <0.00%> (-0.16%) ⬇️
py/objtype.c 100.00% <0.00%> (ø)
py/objenumerate.c 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d934f8c...93ab078. Read the comment docs.

dpgeorge added 2 commits July 8, 2021 12:59
To reduce the number of calls to mp_hal_stdout_tx_strn and improve the
overall throughput of printing data.  This implementation is taken from
ports/stm32/mphalport.c.

Signed-off-by: Damien George <damien@micropython.org>
To reduce code duplication.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge force-pushed the lib-utils-efficient-tx-cooked branch from 93ab078 to 132d938 Compare July 8, 2021 03:00
@dpgeorge dpgeorge merged commit 132d938 into micropython:master Jul 8, 2021
@dpgeorge dpgeorge deleted the lib-utils-efficient-tx-cooked branch July 8, 2021 03:20
tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants