just finished my ECS system in C and it turns out it's ~17x faster than @unity DOTS on the web that's 100k boids at ~90 FPS instead of 17 FPS sharing the code and link for this demo soon, details below 🧵

Jan 8, 2026 · 5:21 PM UTC

126
233
3,647
6,181,617
specs: - Windows 10 64-bit - Chrome (force-high-performance-gpu enabled) - CPU: AMD Ryzen 7 5800H (8 cores / 16 threads) - GPU: NVIDIA GeForce RTX 3060 Laptop GPU - RAM: 32 GB 100k boids simulating, PBR lighting, around 31M triangles drawn per frame
2
129
14,557
implementation is as close to 1-1 as possible to @unity EntitiesSamples repository. WebGPU *and* wasm threads are also enabled for Unity, both are release builds with aggressive optimization flags.
1
96
12,954
note that the FPS difference is about ~5x, this is because the demo is GPU bound. the ECS simulation runs at ~430 FPS on my engine, vs ~22 FPS for @unity. time is measured equally on both demos by sampling how long the ECS World takes to update.
1
65
12,665
my ECS implementation was heavily inspired by flecs, but I included a code generation pass to prevent error prone code like the one you see below
5
1
118
15,001
This engine is commercially available via licensing for select clients. If you're looking for a lightweight, highly performant 3D engine, just send me a DM.
2
121
13,634
Sort replies: Relevant Recent Liked
Replying to @gdechichi @unity
insane performance gains, congrats man! I'm guessing storage size of the system is negligible compared to game assets but does your engine take up less space on disk as well?
1
12
6,550
it does. brotli compressed its 87kb
28
6,078
Replying to @gdechichi @unity
one of the reasons I found no joy in building games with unity / godot / unreal was the atrocious performance.
1
4
435
Replying to @gdechichi @unity
Native C is always faster than a fully fledged game engine. I don't understand the reason for comparison unless it's just a marketing trick to draw people to your link, in which case, good luck.
4
37
4,884
this is an engine, I have an asset system, serialization, physics, rendering abstractions, and actual customers using it. it’s just better implemented than Unity, plain and simple.
2
108
4,678
Replying to @gdechichi @unity
Do you have an idea why the difference is so large? Boids should all end up in one giant table, so the sim should mostly just be iterating plain arrays with very little ECS overhead. Maybe it's a quirk of Unity's web implementation?
2
18
3,712
My guess is the Burst compiler is not as well optimized for WASM as it is for x86. On Windows the simulation time difference is about 3-4x (still huge imo but much smaller)
3
23
3,230
Replying to @gdechichi @unity
Amazing! I remember enjoying your video about Bevy in Rust some time ago. I wonder if Bevy can replicate this same performance.
1
8
5,335
I thinkn I should try to compare it against bevy as well, my guess is it will be close
2
13
4,858
Replying to @gdechichi @unity
makes you wonder what we could be doing if we spent more time optimizing things. awesome stuff
1
8
1,566
that’s why I’m building this engine, we could all be doing so much more
3
1,454
Replying to @gdechichi @unity
Unity has a fuck ton of bloat.
1
6
1,544
basically yeah
6
1,431
Replying to @gdechichi @unity
love seeing raw C outperform big engines. web perf is a wild west. curious how you handled memory layout and cache misses for 100k entities - always the tricky part for me
1
5
2,358
basically entity are stored in SOA tables of components, in pages of 1024. Assume components are small and you always need all the data, this will be very cache friendly
1
6
2,164
Replying to @gdechichi @unity
What's the biggest diff between both? Can you explain the comparison since you used to work on Unity?
1
3
1,007
on the web it’s likely that the Burst compiler is not well optimized for it, or disabled. on native windows the gap is smaller, about 3x. In this case my best explanation is a group of optimizations and architecture decisions: for instance Unity ECS is built on top of the Jobs system which itself has sync overhead. I have a system where all threads are usually at the same code path and it requires less syncs. I haven’t gotten deep into profiling to find out the reason. I’m mostly just showcasing my engine, and this demo is made by Unity itself, so it felt like a fair comparison.
1
4
978
Replying to @gdechichi @unity
ohh really interested in seeing the code :) looks great too, curious what optimizations you made to unity DOTS along the way, found a few while replicating it in clojurescript a few years ago tho didn't reach those perf numbers by generating naked JS :D
Replying to @HostOfMeta
Balls! 3000 moving balls of random sizes and speeds, but all following the same path! Added chromatic abberation to the post-process stack.
1
3
2,694
I actually haven’t used DOTS code as a reference. I used flecs which is much easier to read. your visuals look pretty good there!
1
3
1,323
Replying to @gdechichi @unity
Won’t it be more efficient if pos, velocity, and render data be in one struct? It looks like data is stored as SOA, isnt better to have it as AOS for better prefetching?
1
3
1,239
I don’t think so. You can be run a much tighter simulation loop with just pos and velocity (either SOA or AOS), and then leave rendering for last. I definitely wouldn’t want rendering data in cache lines when I’m running the sim
6
861
Replying to @gdechichi @unity
You might have answered this already, but curious, did Ai tools provide any benefit in your workflow here?
1
1
3,958
yeah AI helps speed up a couple of things, mostly it helps me close knowledge gaps faster than before. so for instance if there is a platform specific thing I never done before it's way faster for me to learn it now.
1
20
3,710