Jump to content

Raspberry Pi Pico vs Pico2

From Squirrel's Lair

Single-core performance of the Pico 2 is considerably higher than the original Pico.

I'd put the code in here but I can't get it to format properly, argh. Anyway...

Part 1 filled the display one pixel at a time.

Part 2 plotted a circle with radius 31 at x=64, y=32 on the display.

Part 3 did the following calculation 1 million times with a (0.31713178593), b (1.578817591983), and c (-5.1383859192): for t in range(0, 1000000, 1):

   d = sqrt(abs(t/((a*b*c)/(a+b+c))))
   e = d**2
   f = ((e*d + 1.1)**5)

Part 4 toggled a pin 1 million times with a simple MicroPython loop, no optimizations.

RESULTS (lower is better)
Test Pico (RP2040) Pico 2 (RP2350)
Part 1 54.825s 49.259s
Part 2 4.333s 3.818s
Part 3 177.167s 68.751s
Part 4 10.384s 5.887s

There's not a big difference in speed when it comes to operations that are bound by peripheral or bus speeds, (like writing to the display), but floating point math and pin toggle times are much faster.

Note that this is with MicroPython v1.23 on the Pico and v1.24.0-preview.321.g0ff782975 on the Pico 2. The code was not optimized and did not use the Native of Viper code emitter for this test.