cd /news/neural-networks/show-hn-static-allocation-mlp-infere… · home topics neural-networks article
[ARTICLE · art-17081] src=github.com pub= topic=neural-networks verified=true sentiment=↑ positive

Show HN: Static-allocation MLP inference in ANSI C using a 2-slot ring buffer

A developer has released a fully static-allocation MLP inference implementation in ANSI C that uses a 2-slot ring buffer to minimize RAM usage on microcontrollers. The approach, developed since 2019, aims to achieve the practical lower bound for memory consumption in general-purpose CPU MLP inference without sacrificing speed or adding runtime complexity. The project is available on GitHub for comparison with other minimal inference implementations.

read1 min publishedMay 29, 2026

I've been experimenting since 2019 with ways to minimize RAM usage for tiny MLP inference on microcontrollers. [0]

This project is the result of that exploration: a fully static-allocation approach to MLP inference in ANSI C, using a simple 2-slot ring buffer to keep memory usage predictable and extremely low, while at the same time fast.

I believe this is close to the practical lower bound for RAM usage in general-purpose CPU MLP inference without sacrificing speed or introducing runtime complexity.

A more aggressive approach I've previously used is allocating and freeing memory per layer-to-layer pair during inference, but that introduces overhead and fragmentation if not used carefully. [1]

Curious how it compares to other minimal inference implementations people have seen (or built). Feedback and edge cases welcome. Hope you like it. Have fun. <3

[0]: [https://github.com/GiorgosXou/NeuralNetworks#-research](https://github.com/GiorgosXou/NeuralNetworks#-research)
[1]: look for REDUCE_RAM_DELETE_OUTPUTS in the source of [0]

Comments URL: [https://news.ycombinator.com/item?id=48318304](https://news.ycombinator.com/item?id=48318304)

Points: 1

── more in #neural-networks 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-static-alloc…] indexed:0 read:1min 2026-05-29 ·