>write c99. >normal looking code. >write "idiomatic c++" (what trannies want you to do). >slow crap

>write c99
>normal looking code
>write "idiomatic c++" (what trannies want you to do)
>slow crap
>write like "c with classes, templates and constexpr"
>blazing fast

  1. 1 month ago
    Anonymous

    >genius discoverers streams are slower than printf
    Can I subscribe to your blog to get daily insights?

    • 1 month ago
      Anonymous

      You didn't noticed the loop is not unrolled? std::for_each version is even worse

      • 1 month ago
        Anonymous

        >crying about loops not being unrolled
        What are cache and branch prediction?

        • 1 month ago
          Anonymous

          Why are you worried about loop unrolling on a routine that needs to call the fucking kernel? The only reason it's not getting unrolled here is because the compiler recognizes that it's a complex enough routine to not be worth it.

          >coping this hard while not understanding programming at all yet wanting to have an opinion

      • 1 month ago
        Anonymous

        Why are you worried about loop unrolling on a routine that needs to call the fucking kernel? The only reason it's not getting unrolled here is because the compiler recognizes that it's a complex enough routine to not be worth it.

  2. 1 month ago
    Anonymous

    >gcc 12.2 -O3
    >gcc 7.2 -O2
    >gcc 12.2 -O3
    nice bait thread

    • 1 month ago
      Anonymous

      Exactly the same code generated.

      • 1 month ago
        Anonymous

        ok, and?

        • 1 month ago
          Anonymous

          Still slow.

      • 1 month ago
        Anonymous

        >exactly the same code
        >j-just ignore the outline view

  3. 1 month ago
    Anonymous

    >C arrays instead of std::array
    Is this C++98?

    • 1 month ago
      Anonymous

      std::array is the most idiotic thing after std::begin() and std::end() and you can't even have arrays with implicit size with std::array. The only reason you might want to use std::array is for passing as argument and returning, which, in fact, this could be easily done by making the C++ only decay array to pointers explicitly by using static_cast, but no, lets create an bullshit class in STL for nothing.

      • 1 month ago
        Anonymous

        I don't know if it depends on c++ version or what, but you can easily write your own code which generates array of implicit size.
        But it seems like a relatively minor thing to get annoyed about. Surely there are use cases for arrays of explicit size... right?

      • 1 month ago
        Anonymous

        std::array does deduce size in C++17. And you won't have to write a size function like a retard because it's in std.

      • 1 month ago
        Anonymous

        there is make_array which deduces for you at the very least

  4. 1 month ago
    Anonymous

    I guess flexibility comes at a slight speed cost. The real question is is this actually significant enough to not be worth it?

    • 1 month ago
      Anonymous

      As things scales up, it will makes difference.

      >slow crap
      Did you benchmark it?

      I do not need to even run it. Loops not unrolled, memory not contiguous (not cache efficient), function calls that could be inlined everywhere, its obviously slower than the "C with classes" style, and its not just because cout vs printf. The only doubt that i have is with "C with classes" vs C99, because at least C99 put everything on the same region.
      True that for this particular C++ code is not even important, but this demonstrates how things will scale up as you write your code.

      • 1 month ago
        Anonymous

        The lack of flexibility also scales up similarly. You're missing the point. Much easier to log with streams. If you need to spend more man hours to do it with printf, but save an irrelevant amount of runtime, then it's not worth it.

  5. 1 month ago
    Anonymous

    >it's another printf is faster than cout for small data thread
    WE KNOW! YOU'RE USING IOSTREAM WRONG!

  6. 1 month ago
    Anonymous

    >Be OP
    >Be a huge dick sucking homosexual
    >Be born into a world of countless tools and innovations
    >Find one specific tool I dislike/find problems with
    >Decide to cry and piss my pants about it instead of just using what I prefer

  7. 1 month ago
    Anonymous

    >slow crap
    Did you benchmark it?

  8. 1 month ago
    Anonymous

    >benchmarking (f)printf vs cout
    L M A O

  9. 1 month ago
    Anonymous

    Tell me you never wrote C++ without telling me you never wrote C++

  10. 1 month ago
    Anonymous

    >more asm means slower execution
    poo tards itt replying to an obvious bait

  11. 1 month ago
    Anonymous

    Wow, it's almost like calling the `<<` operator defined in the standard headers imports more code into your translation unit than calling a function whose implementation is external. Everyone knows streams are slow, you even use `std::endl` here which doesn't make the implementation identical as you'd need `fflush` on the C version.

  12. 1 month ago
    Anonymous

    >nojob retards stir shit day number ?????

  13. 1 month ago
    Anonymous

    Why didn't you check for errors?

  14. 1 month ago
    Anonymous

    Those who put a newline after function return type deserve a special place in hell

  15. 1 month ago
    Anonymous

    any way to improve the rust version? https://godbolt.org/z/zjzGs3vEv

    • 1 month ago
      Anonymous

      Doesn't Rust support C FFI? Just import printf and fprintf.

Your email address will not be published.