frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Benchmarking MicroPython

https://blog.miguelgrinberg.com/post/benchmarking-micropython
21•ibobev•20h ago

Comments

drewcoo•19h ago
Somehow, I don't mind that the code blew the stack because it was recursion without memoization. Blowing the stack should be a pretty clear sign to figure out why and fix it.
mbirth•18h ago
I'm missing testing the different emitters as demonstrated here: https://www.kickstarter.com/projects/214379695/micro-python-...

Not sure whether they're supported on all the architectures, though.

jononor•10h ago
I have added this now, as a reply to one of the other posts :) 100x speedup.
snvzz•17h ago
>pico 2w

ARM or RISC-V?

mrheosuper•15h ago
Generate 2000 random numbers and sorting them using bubble sort on 160Mhz 32bit mcu takes 80 seconds ? This is exactly why micropython is a toy.
jononor•10h ago
The same can be done in 0.02 seconds with MicroPython. I posted optimized code here, https://github.com/jonnor/embeddedml/tree/master/handson/mic...
zem•14h ago
would have been nice to see benchmarks against the equivalent c code running on the same microprocessor, not against micropython code running on different hardware. the post just told me that microprocessors are slow, not how well micropython performs.
wewewedxfgdf•13h ago
As the author points out, performance is pretty much irrelevant - it is a rewrite of python prioritizing memory usage.
jononor•11h ago
This should not be used to conclude on the viability of using MicroPython for numeric type tasks. For that one should at least take into account the following:

Integers are much faster than floats (floats involve a pointer and a heap allocation, integers are stored in a single word/object).

array.array is preferred over list for something like sort. Continuous memory representation of numbers versus general purpose list of objects.

MicroPython has on-board "JIT" (native/viper emitters), have to explicitly annotate the function. Should give 4-10x improvements for this case.

MicroPython has an on-board assembler, so one can write ARM assembly and get that to a function.

MicroPython also has support for C modules, which expose a Python API. Including dynamic native modules which can be installed at runtime with the package manager.

Bubblesort is O(n*2), which hurts for even a few thousand numbers. Actual sorting on a microcontroller should be done with an O(n log n) algorithm.

jononor•10h ago
Ok, you guys have successfully nerd sniped me this morning... Here some experiments showing the use of code emitter to speed this code up massively. Link to code: https://github.com/jonnor/embeddedml/tree/master/handson/mic... The results on ESP32S3 (M5Stick AtomS3U), running MicroPython 1.24.1. All times in seconds, for the 2000 number sort.

bubble.py 19.119

bubble_native.py 9.482

bubble_viper.py 0.904

heapsort_viper.py 0.02

So one can do 100x better without changing the algorithm, and 1000x by changing it :)

Microcontrollers are a constrained platform. They can be plenty fast - but it is much more important to use the tools available, compared to on PC. MicroPython has excellent tools available for this.

jononor•2h ago
EDIT: 20x better with same algorithm, not 100x. Do not post before the coffee starts kicking in...
jononor•9h ago
If anyone is interested in fast dynamic native C modules for MicroPython, you can check out emlearn-micropython - a machine learning and digital signal processing library. https://github.com/emlearn/emlearn-micropython Disclaimer: I am the maintainer
Archit3ch•5h ago
You can drop down to C and call it from MicroPython if you want to count cycles.

Of course, you have to recompile your C every time it changes, which is annoying when you're used to the REPL workflow.

Show HN: Tendly – Ephemeral, privacy-first sharing for files and notes

https://tendly.xyz
1•omojo•1m ago•0 comments

Show HN: Friend's pen-and-calendar tracking → simple staff app

https://apps.apple.com/us/app/simple-staff-tracker/id6749170735
2•Nitishshah700•2m ago•0 comments

Silicon Valley's New Strategy: Move Slow and Build Things

https://www.wsj.com/tech/ai/silicon-valley-ai-infrastructure-capex-cffe0431
2•kjhughes•9m ago•0 comments

Wait, why are we paying more for VSCode forks again?

https://trunk.io/blog/in-defense-of-vscode-why-are-we-paying-for-cursor
3•samgutentag•10m ago•0 comments

NSF suspends nearly 300 UCLA grants (Terence Tao, Plasma Science Facility, etc.)

https://grant-witness.us/nsf-data.html
3•dargscisyhp•12m ago•0 comments

Remove AI Summaries

https://github.com/orjahren/remove-ai-summaries
2•Bogdanp•14m ago•0 comments

Spotify used to seem like a necessary evil for musicians. Now it just seems evil

https://www.theguardian.com/music/2025/jul/31/spotify-musicians-david-bridie-ntwnfb
5•nickcotter•16m ago•1 comments

Live-Action Assassin's Creed Series Coming to Netflix

https://www.ubisoft.com/en-us/company/careers/locations/articles/live-action-assassin-s-creed-series-coming-to-netflix
1•andsoitis•16m ago•0 comments

Qwen3 Coder 480B is Live on Cerebras

https://www.cerebras.ai/blog/qwen3-coder-480b-is-live-on-cerebras
2•retreatguru•18m ago•1 comments

2026: A Tech Odyssey

https://jergling.com/2025/01/21/2026-a-tech-odyssey/
1•BallsInIt•19m ago•0 comments

Why MCP's Disregard for 40 Years of RPC Best Practices Will Burn Enterprises

https://julsimon.medium.com/why-mcps-disregard-for-40-years-of-rpc-best-practices-will-burn-enterprises-8ef85ce5bc9b
2•jmsgwd•19m ago•0 comments

Is Information a Fundamental Force of the Universe? [video]

https://www.youtube.com/watch?v=WqYRMmlZmhM
1•doctoboggan•20m ago•0 comments

How to be a wise optimist about science and technology?

https://michaelnotebook.com/optimism/index.html
1•kiyanwang•20m ago•0 comments

Palantir lands $10B Army software and data contract

https://www.cnbc.com/2025/08/01/palantir-lands-10-billion-army-software-and-data-contract.html
2•rntn•23m ago•0 comments

Rust and Go vs. everything else – Bitfield Consulting

https://bitfieldconsulting.com/posts/rust-and-go
2•chautumn•23m ago•0 comments

Lessons from 10 Years at GitHub

https://rickwinfrey.com/writings/2025/07/04/10-lessons-from-github.html
2•kurinikku•25m ago•0 comments

Google Shifts goo.gl Policy: Inactive Links Deactivated, Active Links Preserved

https://blog.google/technology/developers/googl-link-shortening-update/
20•shuuji3•26m ago•10 comments

Telnyx Voice AI Agents now support inbound MMS during live calls

1•maevesentner•27m ago•0 comments

Lidarts – a free, open-source [scoring] website for darts games

https://github.com/mischkadb/lidarts
1•indigodaddy•27m ago•0 comments

The AI age is the "age of no consent"

https://productpicnic.beehiiv.com/p/the-ai-age-is-the-age-of-no-consent-7559
3•BallsInIt•27m ago•0 comments

Organic Amendments Enhance Maize Growth in Coastal Saline-Alkali Soils

https://www.mdpi.com/2223-7747/14/14/2217
1•PaulHoule•30m ago•0 comments

HTTP Ranges Are Broken for Firefox on GitHub Pages

https://github.com/bdon/ghpages-firefox-range-bug
1•uneekname•30m ago•0 comments

Listening to Ethernet via Eurorack

https://hackaday.com/2025/07/26/listening-to-ethernet-via-eurorack/
1•barnacl437•30m ago•0 comments

The NNCPNET email network

https://lwn.net/SubscriberLink/1031208/a71b294bf7ac1c40/
4•chmaynard•30m ago•1 comments

Show HN

https://onlyusedtesla.ai/assistant
1•adamqureshi•31m ago•0 comments

Show HN: AI system for quantum security analysis (rivals €500k hardware)

1•QuantumSpirit•37m ago•4 comments

Google spends more on capital like datacentres than the entire UK defense budget

https://twitter.com/robertwiblin/status/1951248197881393235
1•bko•37m ago•0 comments

Ask HN: Anyone know how to reach Cloudflare support?

3•OhMeadhbh•37m ago•4 comments

The Industry's Rush to $80 Video Games Has Stalled – For Now

https://www.bloomberg.com/news/newsletters/2025-08-01/the-industry-s-rush-to-80-video-games-has-stalled-for-now
2•speckx•38m ago•0 comments

New York Public Radio, TV Stations Face Big Cuts After Federal Funds Slashed

https://www.insideradio.com/free/new-york-public-radio-tv-stations-face-big-cuts-after-federal-funds-slashed/article_d60e8008-983e-4895-8ddf-1b272c7f6c4e.html
2•walterbell•38m ago•0 comments