Junior Dev Discovers Performance Benchmarks, Demands Rewrite
Description
A Wojak-style meme format. The top caption reads, "the junior dev back in your office asking to rewrite the codebase in Zig:". The image shows an angry-looking cartoon man in glasses sitting at a desk and pointing at his computer monitor. The monitor displays two performance benchmark graphs titled "1 Billion nested loop iterations," comparing various programming languages. The graph on the right, which the character is implicitly referencing, shows "Zig" as one of the top performers. A speech bubble from the character says, "If you would please consult the graphs." This meme satirizes the common experience of senior developers encountering a junior colleague who, having discovered a new, highly performant language or technology, zealously advocates for a complete rewrite of a stable system based on a single metric (like loop speed). It humorously highlights the junior developer's lack of awareness regarding the immense business costs, risks, and complexities involved in such a migration, which far outweigh the benefits of a micro-optimization
Comments
131Comment deleted
Yes, the graph shows Zig is 0.03 seconds faster. Now, can you make a graph showing the 18-month migration cost and the resulting downtime?
Sure, kid - just remember that the only loop tighter than Zig’s is the one you’ll be stuck in answering why the rewrite missed every Q4 deadline
Sure, we saved 0.01 seconds on a billion iterations, but the real benchmark is how long it takes to explain to the board why we spent six months rewriting perfectly working code that processes 10,000 records a day
Ah yes, the classic junior move: proposing a complete rewrite in the hot new language because it shaved 80 milliseconds off a synthetic nested loop benchmark. Never mind that our actual bottleneck is the database queries written by the consultant who left three years ago, or that we'd need to rewrite 500K lines of battle-tested code and retrain the entire team. But sure, let's throw away a decade of domain knowledge and bug fixes because Zig is 15% faster at incrementing integers. I'm sure our customers will really appreciate the six-month development freeze while we chase that marginal performance gain we'll never actually realize in production
Great - let’s spend two quarters rewriting in Zig to shave 40 ms off a path where p99 is dominated by ORM N+1 and chatty microservices; Zig might be fast, but procurement isn’t
I’ll approve the Zig rewrite when the microbenchmark includes porting the build system, redoing every FFI client, retraining the team, and passing compliance - the actual enterprise hot path
Junior graphs loop throughput; senior graphs the hiring funnel post-Zig rewrite
Meanwhile Java performing surprisingly well on those graphs Comment deleted
Then we need another graf representing mental health of developers for each language. I want to see how perform Java developers (pretty sure everyone with mental illness). Comment deleted
C devs in an insane asylum Comment deleted
C - depressed C++ - suicidal Java - they don't know what "therapy" is Python - healthy Ruby - schizophrenic Rust - gay Go - megalomaniac Comment deleted
Morbidly obese at the terminal stage cannot be healthy. Comment deleted
Then what language is healthy? I suppose none... Comment deleted
lua/haskell 😄 Comment deleted
Nah, haskell fans are certainly not healthy. I would say they are nazi, cause they care so much about purity 🥴 Comment deleted
Add more languages, guys Comment deleted
JS/TS - STD Comment deleted
I'll have you know I'm neither healthy nor depressed, and I use both C and Python I am gay though. I haven't done a lot of rust. Comment deleted
I code in C/C++ and am very gay so there's a correlation Comment deleted
I'm starting to feel like there is a correlation between being in IT and being gay Comment deleted
true Comment deleted
afaik there were some research that have shown that in IT there are more LGBT than in general population Comment deleted
I certainly can believe it, i have a few assumptions why, but real reasons is a mystery tbh Comment deleted
probably because IT is a field more accessible for marginalized people Comment deleted
maybe 'cause when you can't communicate with people you start communicating with computers Comment deleted
yup Comment deleted
if you're autistic you either become a computer nerd or a train nerd. if you're queer you don't have the option of train nerd because train companies are weirdly conservative (at least in my experience) Comment deleted
say that with the transfems in fedi infodumping about trains Comment deleted
I mean, yeah, but none of them work in rail, no? Comment deleted
Alan Turing's curse Comment deleted
C# - they know what therapy is but refuse to go to it Comment deleted
That's very accurate(im ex C# dev) Comment deleted
I'm currently in .net why did you left? Comment deleted
I got tired of endless abstractions layers and overloaded .NET ecosystem, it's complex but with no benefits. Basically it's a C++ syndrome. Comment deleted
cross of C++ and Java :) MS wanted to ride Enterprise wave and best they came up with C# Comment deleted
Java is almost the same, but with even more bullshit and requirement to learn 5 frameworks before you even begin to code. MS has ridden the enterprise wave, but they ended up in very boring goverment-related and social applications, Java in that sense is slightly better. Comment deleted
and here I disagree .net is very common in finance and gambling domain Comment deleted
yep, that's true, still not sure if i can call those domains interesting Comment deleted
I would not say .net ecosystem is in any way overloaded generally you have 1 way to "do it right" maybe we're talking about different stuff tho Comment deleted
I'm referring to: "almost mandatory Microsoft.DependencyInjection", which is a framework itself, frameworks for message brokers, frameworks for CQRS. frameworks for databases, several not obvious ways to make an http requests, constantly changing "best-practices" with new versions, and so on. There are just so many high level abstractions. Do you have an experience in other languages? Comment deleted
> several ways for http requests they exist however they are outdated > constantly changing best practices I can swear I can't remember anything like that since .NET 5 (that was many years ago) > experience in other languages yeah, although not much I have some experience in java, c++ but not commercial and some commercial experience in TS/JS Comment deleted
Yes, that what i'm referring to. Is RestClient a current best-practice to make a requests? Just curious, i was really surprised when i discovered this. Comment deleted
Yeah im pretty picky, but imo all of those are overloaded. C++ no comments, about java i already said above, TS/JS ecosystem is a mess. Comment deleted
I guess we just have too much of devs ( probably that are not needed) Comment deleted
Maybe? Not sure if that is a reason for it Comment deleted
TS/JS doesn't have an ecosystem, it has a loose collection of unorganized packages that may or may not work well together Comment deleted
which is kinda to be expected of a language that was built on a messy base, standardized only retroactively during the browser wars Comment deleted
So C Comment deleted
well, myeah, kinda. It's less messy I think because it's older and it runs in a different context where you can afford to just introduce breaking changes to improve things somewhat Comment deleted
That's exactly what I'm talking about! Comment deleted
Clearly Rust is winning EDIT also how is Python healthy‽ Comment deleted
I imagine python users like this: Comment deleted
Unironically what my prev (PHP fanatic) teamlead looked like... Comment deleted
python scripters may be sane, but they are still impostors, I mean they are almost on par with checkbox engineers (UE developers) Comment deleted
:( Comment deleted
Good one Comment deleted
The problem is that c/rust/java/go are software engineer. Python are script folks that like just see something run on a PC (sorry a Mac) Comment deleted
tell that to my 800 line php parser IN PYTHON for my 9k line php project fuck you, man. hurtful stereotypes. Comment deleted
You are just using the library, the works from someone else.. your code is slow by definition. Anyway when you get a problem you need to call an engineer. And yes, since you talk about you 800 lines, meaning that is just a script, chatGPT replace that works soon. Comment deleted
1. I don't need it to be fast, but my code completes in less than a second. speed is a non-consideration. 2. I do need it to not parse ALL of the php because what the parser gets isn't technically valid php (in a way that I can't change) so I can't use an actual php parsing library 3. what the hell do you mean I need to call an engineer? bitch, I am the software engineer. I wrote the whole goddamn website for this company and I'm plenty good at C and Java too. 4. chatGPT won't replace actual programmers. Maybe in 20-50 years they'll automate basic programming tasks, but the amount of obvious garbage code I've had to remove from my coworkers who use chatGPT is baffling. As for parsing the text itself: maybe in 20-50 years, but not in a way that's safe and reproducable. Comment deleted
ig c programmers have it even worse Comment deleted
But Java isn't fun! Comment deleted
I can believe that Java is on par with C in some tasks, given large loop count. But JavaScript? And performing similar to Go? 🤔 Comment deleted
Exactly, that's the biggest giveaway that this benchmark is bullshit Comment deleted
I once saw an "expert-made" benchmark that was optimized out to a NOP (literally, return 0;) on any optimization level starting at "-O1". So he was basically benchmarking execve(). That would be just a dumb joke, if that "expert" guy didn't send his results to Presidential Administration, blaming domestic platform for computational underperformance. Comment deleted
Yeap, I've seen this kind of stuff as well. People see fancy graphics and turn them into a fact of what's faster or slower without thinking about what the benchmark even is or how it was executed Comment deleted
Benchmarks in general don't say as much as people think they do Comment deleted
"There is just one way to benchmark it right, and a million ways to do it wrong. And guess what happens most of the time". 😭 Comment deleted
Yeah, a few days ThePrimagen and Casey Muratori had a stream about those benchmarks, and Muratori said they are BS because you need to understand more on how the language and the interpreter/compiler works to do an appropiate comparison. Comment deleted
Here is the stream on YT: https://www.youtube.com/watch?v=RrHGX1wwSYM The best moment is around 56:00 when Muratori optimize the C code of the benchmark and in the test runs faster in a 2017 computer than in a newer M series Mac 😂 Is a really good stream, because they talk about the stuff that runs under the hood like assembly instructions and how affects the behaviour of different languages. Comment deleted
v8 is weirdly powerful, that's not that surprising. especially small tasks like that can be optimized to death by a JiT like that. Comment deleted
well, it had time and other resources on optimization doesn't js have one of if not the best jit interpreters? ig especially with type-stable and otherwise easy-to-optimize code it should be fast enough Comment deleted
JavaScript has a compiler. Java is actually one of the best assembly languages ever built, he has just a VM interpreter that slows down it, but architecture is awesome Comment deleted
javascript has a JiT (usually. v8 and spidermonkey are both JiTs). java has literally nothing to do with assembly. Normally java gets compiled to custom bytecode (NOT assembly), which is then executed by a JiT. python nowadays gets compiled to bytecode before being interpreted, similar to java (except on machines that have JVM integrated into their CPU, but those are not the default) you're clearly talking about something you have no idea of Comment deleted
IIRC only pypy does this, cpython's jit is experimental (3.13) Comment deleted
bytecode isn't a JiT Comment deleted
i meant this https://docs.python.org/3/whatsnew/3.13.html#an-experimental-just-in-time-jit-compiler Comment deleted
I didn't know they're working on a JiT. but CPython has been compiling to an IR bytecode format since at least python 3.0 Comment deleted
that's what the __pycache__ is caching Comment deleted
interesting read, thanks for sharing ^^ I hope they can solve the problems with C bindings that the folks at pypy were having trouble with Comment deleted
oh i misread Comment deleted
do these machines even exist...? Comment deleted
some ARM processors have (or had?) JVM cores I believe. And basically anything from before 2010 that has a low-powered processor but can run java (something like a DVD player) Comment deleted
but those are probably all microcoded to hell, so I'm not sure how close to machine code JVM code is even then. But then again, so is x64 machine code Comment deleted
me when zen4 supports avx512 thru microcode (and sometimes being slower than avx2 per byte processed) instead of being native Comment deleted
lmao Comment deleted
What do you think is the bytecode? I simply the assembly code for java virtual machine. Is not a bunch of random number, is literally a sequence of assembly instructions. And their particularity is that no register are used for the instructions. I know the JVM architecture and in the past I wrote some code using the java ASM.. Python VM is something completely different, check the two architectures and discover why the performances are so different.. You are clearly talking about something you don't know and don't want to know Comment deleted
What makes Python bytecode not an assembly language? Comment deleted
that's what happens when a compiler is being optimized for 20+ years (also I find it a bit sus that php is so far down… it's usually suprisingly fast, not sure what's going on there. maybe the graphs are old?) Comment deleted
well, it had time and other resources on optimization Comment deleted
and cunning compilers just unwrap loops in half of langs yeah, they *try* to put some "unknown to compiler" variables with user input and rng, but compiler once again is smarter Comment deleted
ZIG PROPAGANDA 🔥 Comment deleted
zig isn't even on the first one Comment deleted
Billions must loop Comment deleted
If your implementation consists of a billion loops, you're already objectively wrong Comment deleted
How else am I supposed to count to a billion Comment deleted
In order to loop billion times, you need to...define a billion Comment deleted
Is a way to build billion operations, but if you have time can create a sequence of instructions Comment deleted
for (i 1 to 1000) for (j 1 to 1000) for (k 1 to 1000) return 1000000000 fastest loop to 1b Comment deleted
C mostly makes me feel gay Comment deleted
C makes me feel safe. My girlfriends make me feel gay Comment deleted
(my GFs also make me feel safe) Comment deleted
C++ just makes me want to start smoking Comment deleted
I've touched php 7.4 a lot recently and it genuinely makes it harder for me to stay nonalcoholic Comment deleted
pfffff Comment deleted
this image speaks a thousand words Comment deleted
rust-style enums? Comment deleted
I don't know what rust-style enums are. php 7.4 doesn't have any enums, so I made a polyfill (ish, I will need to rewrite this later when we fully switch to php 8) Comment deleted
rust-style enums are like enum Result<T, E> { Ok(T), Err(E), } (they can have additional fields and cаn be matched against) Comment deleted
hm, no Comment deleted
(the comments are forced to be there by moodle code standards) Comment deleted
couldn't you leave them as empty? Comment deleted
idk, probably not. it's not that much effort to write a comment, it's just annoying Comment deleted
Uhm Microsoft has that too in UWP but that doesn’t work Comment deleted
longer story: https://doc.rust-lang.org/stable/std/keyword.enum.html Comment deleted
yeah no, I just have key=value. I could maybe put an array as a value but that feels like a bad idea (and it'd mess with some internals) Comment deleted
just say sum types Comment deleted
PHP added enums though... Comment deleted
in 8.0.0, yeah. We've upgraded recently, but most of the code is still in php 7.4 Comment deleted
That's some unrefactored legacy code but you're using the PHP 8 interpreter since 7.4 is fully EOL now, yes? Comment deleted
full context is this: we're developing a Moodle plugin for a school, and until recently the school was using Moodle 4.0.4 with php 7.4 - a few months ago they updated to 4.4.x with 8.x, but we were never officially informed; old plugins tend to still work with new moodle. But I decided that we have to update to a newer Moodle version recently when I had enough of *gestures broadly* all this shit (doesn't help that Moodle<4.2 doesn't have good plugin API docs) we're close to release, so I can't afford to refactor any important code atm. I'm gonna do that once 1.0 is up in prod Comment deleted
I don't even like alcohol and it makes me want to drown my sorrows in it Comment deleted
a good part of it is also moodle having insane code standards for plugins Comment deleted
I wouldn't if I didn't have to Comment deleted
What the hell is zig Comment deleted
ziglang.org Comment deleted
Looks like the demon child of java and c++ Comment deleted
why java Comment deleted
Ok not that similar to java Comment deleted
so just C++ mitosis, noted Comment deleted
C++ should be sterilized, for god's sake Comment deleted