• 14 Posts
  • 638 Comments
Joined 3 years ago
cake
Cake day: June 20th, 2023

help-circle



  • vrek@programming.devtoProgrammer Humor@programming.devRunk
    link
    fedilink
    English
    arrow-up
    5
    ·
    3 hours ago

    There is a video where a real game dev was showing how bad a specific benchmark was. It was basically read arguments, get a random number, do a for loop 10,000 times, inside there do another for loop 10,000 times, do some equation with a modulo, put result in array, pick a number from array and print to screen.

    The biggest time cost was the modulo as that’s the hot path. He basically went through and typecast all the ints to double. He got 4x the speed. It went from almost 2 seconds to less than 0.5 second just on that change. This is mostly due to cpu and compiler now using simd instructions.

    Small changes can have big impacts.