Edited by humans. Written by AI. How our editing works
All articles

CircuitPython Turbo Speeds Python Code on Tiny Boards

Adafruit's CircuitPython Turbo compiles selected Python functions into native code, promising faster microcontrollers while preserving an accessible workflow.

Mike Sullivan

Written by AI. Mike Sullivan

September 18, 20267 min read
Share:
CircuitPython Turbo Speeds Python Code on Tiny Boards

Adafruit’s CircuitPython Turbo has cut a fixed-point Mandelbrot benchmark on a Metro RP2040 board from 8.3 seconds to 0.42 seconds, according to Electronics For You. That works out to nearly 20 times faster, a large enough gain to attract attention even in an industry where benchmarks occasionally arrive wearing more makeup than an MTV presenter in 1987.

The more useful story sits behind the headline number. CircuitPython Turbo lets developers compile selected Python functions into native machine code on a desktop, then load that code onto a microcontroller. Most of an application can retain CircuitPython’s approachable, interactive workflow while demanding sections run closer to the hardware.

This arrangement addresses an old programming problem: people like expressive languages, while processors remain stubbornly interested in instructions they can execute. On a desktop or server, extra computing capacity can conceal much of that disagreement. A small board has tighter limits on processing speed, memory and power. Abstraction eventually receives an invoice.

What CircuitPython Turbo Changes

CircuitPython is designed to make programming microcontrollers accessible through Python. That accessibility has costs. An interpreter must examine and execute Python code at runtime, adding overhead compared with machine code prepared for the target processor.

Turbo moves selected compilation work to a host computer. Adafruit describes it as a host-side toolchain that compiles chosen functions, provides device demonstrations and includes a measured RP2040 comparison. The developer identifies the sections that need acceleration rather than converting the whole application.

Slashdot characterizes the workflow as a way to preserve high-level development while allowing performance-critical code to run near the hardware. Hackster.io similarly reports gains of up to 20 times for demanding functions.

The phrase “up to” is doing its customary bench press. A Mandelbrot calculation repeatedly performs arithmetic in a tight loop, making it a favorable target for native compilation. Programs that spend their time waiting for sensors, sleeping between events, updating a slow display or communicating over a network may see a smaller overall improvement. Accelerating a calculation does little when the application is waiting for a thermometer to answer.

A useful evaluation therefore needs more than the peak multiplier. Developers should ask how much execution time their program spends inside the compiled function, how much overhead arises when crossing between interpreted and native code, and whether the optimization changes memory use or power consumption. The available reports establish a striking RP2040 result. They do not establish a broad performance profile across boards, workloads and application designs.

An Old Strategy Reaches Smaller Boards

Turbo belongs to a long family of attempts to combine high-level programming with lower-level speed. Just-in-time compilers translate code while a program runs. Ahead-of-time compilers prepare it before deployment. Native extensions let languages such as Python delegate intensive jobs to compiled components.

Developers have used these arrangements for decades because rewriting an entire project in a lower-level language creates its own expenses. Development takes longer, memory errors become easier to introduce, and fewer people can modify the result. Selective compilation offers a compromise: optimize the hot path and leave the menu system, configuration logic and general glue code alone.

MicroPython already provided relevant precedent. Hackaday describes CircuitPython as a fork of MicroPython and reports that CircuitPython previously ran in interpreted mode without MicroPython’s Viper option. Turbo now allows CircuitPython users to flag sections for native or Viper compilation and load code prepared on a desktop.

That lineage keeps the announcement in proportion. Adafruit has applied an established language implementation strategy to its beginner-friendly microcontroller ecosystem. The engineering can still be useful without requiring us to pretend selective native compilation fell through a wormhole from 2047.

The integration may prove more important than the underlying concept. A feature hidden behind a brittle build chain serves experts who could probably write C anyway. A feature documented within the normal CircuitPython learning environment could reach students, artists, hardware hobbyists and product developers who began with Python for a reason.

Selectivity is Both the Feature and the Catch

Compiling only chosen functions creates a sensible division of labor. Python handles experimentation and application structure; native code handles repeated arithmetic or other processor-heavy work. Developers can focus their effort where profiling shows a bottleneck.

That division also creates a boundary inside the program. Compiled functions may support fewer language features than ordinary CircuitPython code. Values must cross between interpreted and native contexts. Error messages and debugging behavior may differ. Compiled output can depend on a processor architecture or board target, reducing the portability that makes Python attractive in the first place.

Memory complicates the calculation further. Native code can run faster while consuming space that a constrained board needs elsewhere. A speed improvement could allow the processor to finish sooner and sleep longer, potentially helping energy use, but the cited sources do not provide enough evidence to claim a general battery-life gain. Board, workload, compiler output and sleep behavior would all affect the result.

These constraints do not make Turbo a poor design. They define the job it can do. A tight graphics routine, signal-processing loop or mathematical calculation presents a clearer use case than an application dominated by input and output. Performance tuning still begins with measurement, an unfashionable practice that has survived every computing trend since beige towers roamed the earth.

Turbo also changes the maintenance question. A pure CircuitPython project can be easy to inspect and move between compatible devices. Adding compiled functions introduces generated artifacts and a host toolchain. Teams will need to preserve build instructions, compiler versions and target information if they expect to reproduce the software later. “It worked on my laptop” has now received a very small circuit board.

The Educational Case May Be Stronger than the Benchmark

CircuitPython lowers the first barrier to embedded programming. Learners can work with familiar syntax without beginning with pointers, registers and a compiler configuration that looks like a tax form. Turbo could extend that path by introducing optimization only after a project encounters a performance limit.

Handled well, the workflow can teach an important lesson about abstraction. Python does not repeal processor architecture. It lets a learner postpone that topic until the hardware makes the tradeoff visible. A slow animation or mathematical routine can then become an opportunity to profile code, identify a hot function, compile it and compare the outcome.

Handled poorly, Turbo could become another magic-speed button. Students may learn to attach a compiler directive whenever a program feels sluggish, without investigating whether the delay comes from computation, communication or poor program structure. Adafruit’s documentation and tooling will determine how much of the underlying boundary users can see.

The same issue matters outside classrooms. A prototype built quickly in CircuitPython may reach a point where performance once forced a partial or complete rewrite. Selective compilation could let some projects travel farther before making that jump. It will not automatically supply deterministic timing, comprehensive hardware access, mature debugging or every other property required by deployed embedded systems. Those requirements vary too widely for one benchmark to settle the question.

What to Watch Next

The current evidence supports a narrow and useful claim: CircuitPython Turbo can deliver a large speed increase when a suitable compute-heavy function is compiled for an RP2040 board. Broader claims need broader tests.

Useful follow-up measurements would cover additional processors, integer and floating-point workloads, graphics, memory consumption, compiled-code size, toolchain friction and energy use. Documentation should also make unsupported Python features and portability limits easy to find. Developers can tolerate restrictions. Surprise restrictions are where Saturday afternoons go to die.

CircuitPython Turbo’s success will depend on whether developers can identify a slow function, compile it, understand the compromises and reproduce the build without becoming embedded-toolchain archaeologists. The 19-fold Mandelbrot result opens the door. Everyday projects will decide how many people walk through it.

More Like This

Black HDMI 2.1 cable with gold connectors against grid background, labeled "8K & 4K 120 FPS" in bold text with red oval…

Do You Really Need an $80 HDMI Cable? Maybe Not

Tech reviewer Adam tests a premium HDMI 2.1 cable. We examine what you're actually paying for and whether most users need it.

Mike Sullivan·7 months ago·6 min read
Laptop displaying Unreal Engine 5.7 announcement with purple branding, surrounded by gaming figurines on wooden desk

Can Unreal Engine 5 Run on a $500 MacBook? Sort Of.

Testing Unreal Engine 5.7 on the MacBook Neo reveals what happens when professional software meets budget hardware—and why friction matters.

Mike Sullivan·5 months ago·5 min read
Bearded man beside CERN and Debian logos, California flag, and “AGE VERIFY UPDATE” and “LINUX FROM SCRATCH” banners

CERN Picks Debian, Ubisoft Blocks For Honor on Linux: Week in Review

CERN ditches RHEL for Debian on accelerator systems, California exempts open source from age checks, and Ubisoft blocks For Honor. Mike Sullivan sorts it out.

Mike Sullivan·2 weeks ago·6 min read
A gear logo with "R" on the left, accompanied by white and red text reading "COMPILE 2X FASTER" on a black background.

Cutting Rust Compile Times Nearly in Half

Three Cargo and compiler optimizations can slash Rust build times by nearly 50%. Here's what each one costs you, and what you get in return.

Dev Kapoor·1 month ago·7 min read
Bold orange and white text announcing Claude Code Hidden Mode against a dark dotted background with a toggle switch and…

Claude Code's Hidden Features That Actually Matter

Claude Code ships features faster than users can discover them. Here's what's buried in config files that could fix your biggest workflow problems.

Tyler Nakamura·6 months ago·6 min read
Python logo points via a red arrow toward the Rust gear logo on a black background

How uv Made Python Packaging 100 Times Faster

Astrals uv installs Python packages up to 100x faster than pip. Three engineering decisions explain the speed, and each one carries a lesson about legacy tools.

Marcus Chen-Ramirez·2 weeks ago·7 min read
TypeScript 7 Go Rewrite announcement with red cartoon mascot character and "10x faster" claim on dark background

TypeScript 7 Rewrites Its Compiler in Go for 10x Speed

TypeScript 7's RC rewrites the compiler in Go, delivering roughly 10x faster type checking. Here's what actually changed and what it means for your build.

Mike Sullivan·3 months ago·7 min read
Blue racing drone surrounded by components under red LED lighting with "NOT A TUTORIAL" text overlay

TBS Source One V6 FPV Build: Cheap Frame, Real Costs

FPV Geek builds the TBS Source One V6 freestyle quad and hits a power layout problem that forced a full rework. Here's what actually happened.

Mike Sullivan·3 months ago·7 min read