I rewrote the exact same raytracer in C, Rust, Python, and JavaScript — same scene, same rules, zero external libraries.
Four languages. One identical scene (camera + 138 spheres + materials). Only the pure render loop was timed. No shortcuts.
Results:
• Python → 55 seconds
• JavaScript → 0.74 seconds
• Rust → 0.25 seconds
• C → 0.19 seconds
C won. Rust came in just 7% behind. JavaScript crushed Python by 74×. The gap between slowest and fastest: 187×.
This is what happens when you force every language to play by the same strict rules and measure only the math that actually matters.
All source code + the live comparison page are linked below.
Go break it, prove me wrong, or tell me which language I should torture next.
🔗 Code & live comparison:
🔔 Subscribe for more painful language experiments.
#programming #rust #c #python #javascript #raytracing #benchmark #coding
source

why didnt you -O3 it ?
Lo sentimos, el archivo que has solicitado no existe.
What about AssemblyHow about comparing the speeds of D language and C in the next video?Alright, next is ZIG
i cant understand how javascript runs off hopes and dream yet has decent performance
Straight to the point love it
common lisp
Ассемблер надо держать как точку отсчёта для других языков.
2:14 i don't understand why you'd even need classes for rendering a scene lol
Try lua next
AI Slop
try go.
Your description makes no sense:
"• Rust → 0.19 seconds
• C → 0.25 seconds
C won. Rust came in just 7% behind"
Why are you saying C won when Rust was quicker??
GDScript
the hell is this AI generated stuff
Please do java, kotlin, go. With concurency and without
bro run c with -O2 flag insted of -O3 and didn't us all optimizing flags, gcc insted of clang, use strust with evryfing insted of union + enume, didn't use PGO. the same with rust. cargo in release gives you terrible optimization options and you have to override them (e.g. if you have a loop with a vector for 10000 objects, rust checks 10000 times if you haven't gone beyond the index – you can disable it with a flag (or use unsafe)) or as default you have disabled the jamp table for switch, which slows down the program enormously if you use them constantly in eg switch
If you want to show naive transfer of OOP logic "head-on" without optimization for the runtime architecture, its nice comparition but between python and JS.
In C you wrote flat structures with switches , in JS you've created a bunch of dynamic objects, causing constant heap allocations, garbage collection pressure, and CPU cache misses. You cant compare it like this.
Interesting "Rools" you had
Python: You just wanted to make fun of me
Rule #3 brings an unfair disadvantage and exist only to favor C. One of the biggest reasons of using a language with with an extensive ecosystem is the ecosystem. Be honest and use full features of each language. You'll be surprised.
I think we can use unsafe rust if we know what we are doing to speed things up.
Files are incorrect in the description. 404
Assambly
2:25 C has unions
How long did Rust take to compile? How much memory and CPU did it take?
What JavaScript did you run? Was it in a browser or was it some other implementation?
Was python cpython or mypy or something?
These details seemed to have been skipped.
Also counting rust as the winner for a near miss for unrelated details to the test doesn't work. I hardly ever run into lost pointers in the first place and it's much more readable imo than rust is. Spending extra time waiting for compiling and letting it blow out my ram doesn't count as a win for me.
C also has unions. I bet it would be even faster since you're not copying as much data.
Nice comparison