Skip to content
DevMeme
5925 of 7590
Juniors Post #6488 · source on Telegram

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

131
Anonymous ★ Top Pick 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?
  1. Anonymous ★ Top Pick

    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?

  2. Anonymous

    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

  3. Anonymous

    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

  4. Anonymous

    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

  5. Anonymous

    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

  6. Anonymous

    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

  7. Anonymous

    Junior graphs loop throughput; senior graphs the hiring funnel post-Zig rewrite

  8. @TheFloofyFloof 1y

    Meanwhile Java performing surprisingly well on those graphs

    1. @realVitShadyTV 1y

      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).

      1. @TheFloofyFloof 1y

        C devs in an insane asylum

      2. @noi01 1y

        C - depressed C++ - suicidal Java - they don't know what "therapy" is Python - healthy Ruby - schizophrenic Rust - gay Go - megalomaniac

        1. @Araalith 1y

          Morbidly obese at the terminal stage cannot be healthy.

          1. @noi01 1y

            Then what language is healthy? I suppose none...

            1. @mira_the_cat 1y

              lua/haskell 😄

              1. @noi01 1y

                Nah, haskell fans are certainly not healthy. I would say they are nazi, cause they care so much about purity 🥴

        2. @noi01 1y

          Add more languages, guys

          1. @Araalith 1y

            JS/TS - STD

        3. @RiedleroD 1y

          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.

          1. @niko2048 1y

            I code in C/C++ and am very gay so there's a correlation

            1. @noi01 1y

              I'm starting to feel like there is a correlation between being in IT and being gay

              1. @niko2048 1y

                true

              2. @mira_the_cat 1y

                afaik there were some research that have shown that in IT there are more LGBT than in general population

                1. @noi01 1y

                  I certainly can believe it, i have a few assumptions why, but real reasons is a mystery tbh

                2. @RiedleroD 1y

                  probably because IT is a field more accessible for marginalized people

                3. @callofvoid0 1y

                  maybe 'cause when you can't communicate with people you start communicating with computers

                  1. @RiedleroD 1y

                    yup

                    1. @RiedleroD 1y

                      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)

                      1. @echedelle 1y

                        say that with the transfems in fedi infodumping about trains

                        1. @RiedleroD 1y

                          I mean, yeah, but none of them work in rail, no?

              3. @niko2048 1y

                Alan Turing's curse

        4. @digital_insanity 1y

          C# - they know what therapy is but refuse to go to it

          1. @noi01 1y

            That's very accurate(im ex C# dev)

            1. @digital_insanity 1y

              I'm currently in .net why did you left?

              1. @noi01 1y

                I got tired of endless abstractions layers and overloaded .NET ecosystem, it's complex but with no benefits. Basically it's a C++ syndrome.

                1. @hafijuldev 1y

                  cross of C++ and Java :) MS wanted to ride Enterprise wave and best they came up with C#

                  1. @noi01 1y

                    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.

                    1. @digital_insanity 1y

                      and here I disagree .net is very common in finance and gambling domain

                      1. @noi01 1y

                        yep, that's true, still not sure if i can call those domains interesting

                2. @digital_insanity 1y

                  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

                  1. @noi01 1y

                    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?

                    1. @digital_insanity 1y

                      > 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

                      1. @noi01 1y

                        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.

                      2. @noi01 1y

                        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.

                        1. @hafijuldev 1y

                          I guess we just have too much of devs ( probably that are not needed)

                          1. @noi01 1y

                            Maybe? Not sure if that is a reason for it

                        2. @RiedleroD 1y

                          TS/JS doesn't have an ecosystem, it has a loose collection of unorganized packages that may or may not work well together

                          1. @RiedleroD 1y

                            which is kinda to be expected of a language that was built on a messy base, standardized only retroactively during the browser wars

                          2. @TheFloofyFloof 1y

                            So C

                            1. @RiedleroD 1y

                              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

                          3. @noi01 1y

                            That's exactly what I'm talking about!

        5. @TheRamenDutchman 1y

          Clearly Rust is winning EDIT also how is Python healthy‽

          1. @noi01 1y

            I imagine python users like this:

            1. @TheRamenDutchman 1y

              Unironically what my prev (PHP fanatic) teamlead looked like...

        6. @GioMetal 1y

          python scripters may be sane, but they are still impostors, I mean they are almost on par with checkbox engineers (UE developers)

          1. @RiedleroD 1y

            :(

          2. @noi01 1y

            Good one

        7. C. 1y

          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)

          1. @RiedleroD 1y

            tell that to my 800 line php parser IN PYTHON for my 9k line php project fuck you, man. hurtful stereotypes.

            1. C. 1y

              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.

              1. @RiedleroD 1y

                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.

      3. @mira_the_cat 1y

        ig c programmers have it even worse

    2. @noi01 1y

      But Java isn't fun!

    3. @SamsonovAnton 1y

      I can believe that Java is on par with C in some tasks, given large loop count. But JavaScript? And performing similar to Go? 🤔

      1. Vinicius Nascimento 1y

        Exactly, that's the biggest giveaway that this benchmark is bullshit

        1. @SamsonovAnton 1y

          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.

          1. Vinicius Nascimento 1y

            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

            1. @qtsmolcat 1y

              Benchmarks in general don't say as much as people think they do

            2. @SamsonovAnton 1y

              "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". 😭

            3. @eescarez 1y

              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.

            4. @eescarez 1y

              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.

      2. @RiedleroD 1y

        v8 is weirdly powerful, that's not that surprising. especially small tasks like that can be optimized to death by a JiT like that.

      3. @mira_the_cat 1y

        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

      4. C. 1y

        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

        1. @RiedleroD 1y

          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

          1. @sylfn 1y

            IIRC only pypy does this, cpython's jit is experimental (3.13)

            1. @RiedleroD 1y

              bytecode isn't a JiT

              1. @sylfn 1y

                i meant this https://docs.python.org/3/whatsnew/3.13.html#an-experimental-just-in-time-jit-compiler

                1. @RiedleroD 1y

                  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

                  1. @RiedleroD 1y

                    that's what the __pycache__ is caching

                2. @RiedleroD 1y

                  interesting read, thanks for sharing ^^ I hope they can solve the problems with C bindings that the folks at pypy were having trouble with

              2. @sylfn 1y

                oh i misread

          2. @sylfn 1y

            do these machines even exist...?

            1. @RiedleroD 1y

              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)

              1. @RiedleroD 1y

                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

                1. @sylfn 1y

                  me when zen4 supports avx512 thru microcode (and sometimes being slower than avx2 per byte processed) instead of being native

                  1. @RiedleroD 1y

                    lmao

          3. C. 1y

            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

            1. @purplesyringa 1y

              What makes Python bytecode not an assembly language?

    4. @RiedleroD 1y

      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?)

    5. @mira_the_cat 1y

      well, it had time and other resources on optimization

  9. @Essonaby 1y

    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

  10. @Algoinde 1y

    ZIG PROPAGANDA 🔥

  11. @kirisoraa 1y

    zig isn't even on the first one

  12. @lemarwin 1y

    Billions must loop

  13. @lapdotcom 1y

    If your implementation consists of a billion loops, you're already objectively wrong

    1. @qtsmolcat 1y

      How else am I supposed to count to a billion

      1. @noi01 1y

        In order to loop billion times, you need to...define a billion

    2. C. 1y

      Is a way to build billion operations, but if you have time can create a sequence of instructions

  14. @azizhakberdiev 1y

    for (i 1 to 1000) for (j 1 to 1000) for (k 1 to 1000) return 1000000000 fastest loop to 1b

  15. @niko2048 1y

    C mostly makes me feel gay

    1. @RiedleroD 1y

      C makes me feel safe. My girlfriends make me feel gay

      1. @RiedleroD 1y

        (my GFs also make me feel safe)

  16. @niko2048 1y

    C++ just makes me want to start smoking

    1. @RiedleroD 1y

      I've touched php 7.4 a lot recently and it genuinely makes it harder for me to stay nonalcoholic

      1. @niko2048 1y

        pfffff

      2. @RiedleroD 1y

        this image speaks a thousand words

        1. @sylfn 1y

          rust-style enums?

          1. @RiedleroD 1y

            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)

            1. @sylfn 1y

              rust-style enums are like enum Result<T, E> { Ok(T), Err(E), } (they can have additional fields and cаn be matched against)

              1. @RiedleroD 1y

                hm, no

                1. @RiedleroD 1y

                  (the comments are forced to be there by moodle code standards)

                  1. @sylfn 1y

                    couldn't you leave them as empty?

                    1. @RiedleroD 1y

                      idk, probably not. it's not that much effort to write a comment, it's just annoying

                  2. @ZgGPuo8dZef58K6hxxGVj3Z2 1y

                    Uhm Microsoft has that too in UWP but that doesn’t work

              2. @sylfn 1y

                longer story: https://doc.rust-lang.org/stable/std/keyword.enum.html

                1. @RiedleroD 1y

                  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)

              3. @mira_the_cat 1y

                just say sum types

        2. @TheRamenDutchman 1y

          PHP added enums though...

          1. @RiedleroD 1y

            in 8.0.0, yeah. We've upgraded recently, but most of the code is still in php 7.4

            1. @TheRamenDutchman 1y

              That's some unrefactored legacy code but you're using the PHP 8 interpreter since 7.4 is fully EOL now, yes?

              1. @RiedleroD 1y

                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

      3. @RiedleroD 1y

        I don't even like alcohol and it makes me want to drown my sorrows in it

        1. @RiedleroD 1y

          a good part of it is also moodle having insane code standards for plugins

  17. @RiedleroD 1y

    I wouldn't if I didn't have to

  18. Mario 1y

    What the hell is zig

    1. @sylfn 1y

      ziglang.org

      1. Mario 1y

        Looks like the demon child of java and c++

        1. @sylfn 1y

          why java

          1. Mario 1y

            Ok not that similar to java

            1. @purplesyringa 1y

              so just C++ mitosis, noted

        2. @noi01 1y

          C++ should be sterilized, for god's sake

Use J and K for navigation