A bit old but still interesting

    • neidu3@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      4
      arrow-down
      3
      ·
      10 months ago

      Python should be even further down - this list doesn’t account for the fact that you have to rewrite everything because “That’s not pythonic”.

      Perl should be higher up because it let’s you just do the things with some weird smileys without jumping through hoops.

    • kureta@lemmy.ml
      link
      fedilink
      arrow-up
      3
      ·
      10 months ago

      Why? Typescript transpiles into js but maybe the transpiler intruduces some overhead, isn’t it possible? I am not familiar with these languages, so this is an honest question.

      • FizzyOrange@programming.dev
        link
        fedilink
        arrow-up
        6
        ·
        10 months ago

        It’s barely transpiled. There are a couple of features that involve actual code generation - enums and namespaces (which are almost never used), but the vast majority of it is just stripping the type annotations so the performance will be 100% identical.

        It’s like having “Python” and “Python with type hints” as separate languages and claiming there is a big speed difference between them.

        • MinekPo1 [it/she]@lemmygrad.ml
          link
          fedilink
          English
          arrow-up
          1
          ·
          10 months ago

          I was originally going to comment that differences in performance between JS and TS appear to be most significant in one challenge

          ascii table about that, not screen reader friendly
           ___________________________________________________________________________________________________________________ 
          |lang|_binary_trees___________|_fannkuch-redux_____________|_fasta_____________________|_normalized_________________|
          | JS | 312.14 : 21.349 :  916 |    413.90 :    33.663 : 26 |  64.84 :  5.098 :      30 |     4.45 :    6.52 :  4.59 |
          |_TS_|_315.10_:_21.686_:__915_|__6 898.48_:___516.541_:_26_|__82.72_:__6.909_:_____271_|____21.50_:___46.20_:__4.69_|
          |diff|___+.9%_:__+1.6%_:_+.1%_|_+15_66.7%_:_+14_34.4%_:_0%_|_+21.6%_:_+35.5%_:_+803.3%_|_+3_83.1%_:_+6_08.5_:_+8.1%_|
          

          however, trying to look to see the typescript code, wanting to translate that to type hinted python code, I’ve been unable to find typescript on CLBG, so I’m confused on how they got that data,

  • ExperimentalGuy@programming.dev
    link
    fedilink
    arrow-up
    3
    ·
    10 months ago

    Does anyone understand the Pearson coefficient part enough to explain it? I don’t really understand why they’re measuring correlation between memory, energy, and time in that way/ how you’d interpret it.

  • PokerChips@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    10 months ago

    Very impressive study. I was surprised to learn that Ruby was categorized as functional but not object oriented. I thought that was their whole shstick.

  • SuperFola@programming.dev
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    6
    ·
    10 months ago

    I find this paper false/misleading. They just translated one algorithm in many languages, without using the language constructs or specificities to make the algorithm decent performant wise.

    Also it doesn’t mean anything, as you aren’t just running your code. You are compiling/transpiling it, testing it, deploying it… and all those operations consume even more energy.

    I’d argue that C/C++ projects use the most energy in term of testing due to the quantity of bugs it can present, and the amount of CPU time needed just to compile your 10-20k lines program. Just my 2 cents

    • atzanteol@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      12
      arrow-down
      1
      ·
      10 months ago

      I find this paper false/misleading.

      They presented their methodology in an open and clear way and provide their data for everyone to interpret. You can disagree with conclusions but it’s pretty harsh to say it’s “misleading” simply because you don’t like the results.

      They just translated one algorithm in many languages, without using the language constructs or specificities to make the algorithm decent performant wise.

      They used two datasets, if you read the paper… It wasn’t “one algorithm” it was several from publicly available implementations of those algorithms. They chose an “optimized” set of algorithms from “The Computer Language Benchmarks Game” to produce results for well-optimized code in each language. They then used implementations of various algorithms from Rosetta Code which contained more… typical implementations that don’t have a heavy focus on performance.

      In fact - using “typical language constructs or specificities” hurt the Java language implementations since List is slower than using arrays. It performed much better (surprisingly well actually) in the optimized tests than in the Rosetta Code tests.

      • FizzyOrange@programming.dev
        link
        fedilink
        arrow-up
        2
        arrow-down
        2
        ·
        10 months ago

        They chose an “optimized” set of algorithms from “The Computer Language Benchmarks Game” to produce results for well-optimized code in each language.

        Honestly that’s all you need to know to throw this paper away.

          • FizzyOrange@programming.dev
            link
            fedilink
            arrow-up
            1
            ·
            10 months ago

            It’s a very heavily gamed benchmark. The most frequent issues I’ve seen are:

            • Different uses of multi-threading - some submissions use it, some don’t.
            • Different algorithms for the same problem.
            • Calling into C libraries to do the actual work. Lots of the Python submissions do this.

            They’ve finally started labelling stupid submissions with “contentious” labels at least, but not when this study was done.

              • FizzyOrange@programming.dev
                link
                fedilink
                arrow-up
                1
                ·
                10 months ago

                I agree, but if you take away the hard numbers from this (which you should) all you’re left with is what we all already knew from experience: fast languages are more energy efficient, C, Rust, Go, Java etc. are fast; Python, Ruby etc. are super slow.

                It doesn’t add anything at all.

                • atzanteol@sh.itjust.works
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  10 months ago

                  Well… No. You’re reading the title. Read the document.

                  “We all know” is the gateway to ignorance. You need to test common knowledge to see if it’s really true. Just assuming it is isn’t knowledge, it’s guessing.

                  Second - it’s not always true:

                  for the fasta benchmark, Fortran is the second most energy efficient language, but falls off 6 positions down if ordered by execution time.

                  Thirdly - they also did testing of memory usage to see if it was involved in energy usage.