2020 study pdf.

After seeing this a couple years ago I started to be more responsible for my PHP code, writing it even with the slightest micro-optimizations possible, since more times people use my code (especially due to nature of PHP being executed in every http request), more energicity they waste because of my lazyness and more they pollute the planet. JIT was NOT included in this experiment, so the number can be much more lower.

I hope you will be responsible for your code so on too (generally I mean people using interpreted languages).

  • mr47@kbin.social
    link
    fedilink
    arrow-up
    14
    ·
    1 year ago

    Quite a few unexpected results here…

    1. I’m surprised the C binary is not the smallest, and it’s outdone by Pascal, of all languages.
    2. The speed/energy difference between Java and C# (almost a factor of 2 in favor of Java).
    3. The relatively good performance of JavaScript compared to other loosely typed multi-paradigm scripting languages.
    4. The difference between C# and F#. That’s actually a good reason to question the accuracy of these tests and results.
    • words_number@programming.dev
      link
      fedilink
      arrow-up
      11
      ·
      edit-2
      1 year ago

      The JS one is not surprising at all. There’s no other loosely typed multi-paradigm scripting language where such insane shitloads of money and developer time have been spent for optimizing its execution (by some of the largest tech companies). Kinda funny considering that the language design is complete horse shit.

      Your 2nd point is really quite surprising. I also wouldn’t have thought that java would beat Go in both energy and time by that margin!

    • Tamlyn
      link
      fedilink
      arrow-up
      13
      arrow-down
      3
      ·
      1 year ago

      Without any information how this test result got achieved. It’s kind of useless. It’s like to read the headline of a paper. So sure you should question the accuracy of this image. But i would agree it’s fun to look at it

    • sim642@lemm.ee
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      Pascal is a simpler and more limited language, so it’s not entirely surprising. It also has less and smaller standard libraries to link in.

      As to C# and F#, what’s wrong with the difference? The functional coding style of F# prefers immutable data over possibly mutable ones in C# and that requires more allocations and garbage collection.

      • mr47@kbin.social
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        I haven’t looked into the details of the actual code, but I would expect the compiler optimizations and JIT to figure it all out and end up with very similar native code. Especially since both languages are mature and had enough time to reach such goals. But it’s quite possible my assumptions are incorrect.