diff options
| author | Matt Johnston <[email protected]> | 2025-07-11 17:38:42 +0800 |
|---|---|---|
| committer | Matt Johnston <[email protected]> | 2025-07-15 16:40:37 +0800 |
| commit | e2ceb2b1f7cd0fd7778b53aaf8ba1caa71b2f7f5 (patch) | |
| tree | 53adf1ef9d2086d7500154421ad2691100cf7038 /embassy-rp | |
| parent | f53b6649dd42918f7d5228d06821ac5b95e33d38 (diff) | |
otg: Improve IN write performance
chunks_exact() can be handled by the compiler more efficiently.
Previous code was making a memcpy call for each 4 byte chunk slice.
Hoisting the fifo out of the loop avoids recalculating the pointer each
time.
In my benchmark I see a jump from ~13 megabyte/sec to ~25MB/sec after
this change (opt-level=3). opt-level = "z" goes 9MB/s to 18MB/s.
The benchmark was on a stm32h7s3l8, 600mhz clock, 512 byte bulk writes,
data in DTCM. The benchmark isn't just USB writes, also has some
unrelated memcpys for packet construction.
Diffstat (limited to 'embassy-rp')
0 files changed, 0 insertions, 0 deletions
