improve fifo performance? #1411
Unanswered
myklemykle
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The FIFO now is built for correctness, not for speed, sorry. Because we need to use the HW FIFO to cause an IRQ on the other core for freeze-CPU operations (i.e. while doing flash erase/write) it doesn't use the HW FIFO for It uses the Pico-SDK's multi-core, multi-thread safe queues: arduino-pico/cores/rp2040/RP2040Support.h Lines 70 to 84 in f33dfd2 If you have a simple 1-producer/1-consumer setup it should be possible for you to implement a simple, lockless FIFO (as done in the SerialUART code) in your own code, and not use the built-in heavy duty queueing functions. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm profiling the main loop in a multicore pico program that sends a single 32-bit value from core0 to core1 on every loop.
The entire loop takes about 300 usec to finish, on average. My profiling suggests that a single call to rp2040.fifo.push_nb(), to send 32 bits from core0 to core1, is taking about 30 usec to complete, on a chip that's running at 133mhz. That comes to about 4000 clock cycles to complete the non-blocking function. That's a tenth of the loop, for one line of code. Is that the expected performance of this fifo implementation? Anything I can to to make it faster?
Thanks in advance,
-mykle-
p.s. In general I am really loving the arduino-pico environment! Works great, with great documentation.
Beta Was this translation helpful? Give feedback.
All reactions