False Sharing - A Phenomenon on Modern CPUs

Поділитися
Вставка
  • Опубліковано 4 лис 2024

КОМЕНТАРІ • 6

  • @joao-pedro-braz
    @joao-pedro-braz Рік тому +1

    Glad UA-cam recommended me this, learned a lot! Thanks!

  • @nitsanbh
    @nitsanbh Рік тому

    I’m too glad it was recommended to me!
    Thank you!
    I think the first 10 mins of the video could be spared if you wrote the code beforehand, and just go thru each line in the vid

  • @thomasq5186
    @thomasq5186 Рік тому

    Very nice video! I just have one question: I don't think you explained why sometimes you got the 1.3s time on the first version of the code.
    I ran it like 100x on my computer and my results were either between 2.3 and 2.38 seconds or between 2.0 and 2.09 but couldn't get anything lower than 2s. (note that not once did I get a 2.1x or 2.2x or anything outside the ranges I mentioned. Maybe my 2.0/2.09 times is equivalent to your 1.3x times)

    • @simonracz
      @simonracz  Рік тому

      Thanks for sharing your numbers!
      I had an argument in my mind when I talked about the 1.3 second runtime, which turned out to be wrong. I also wanted to run it till the viewer sees that it varies greatly. Not just 2 seconds long all the time.
      My current guess at the moment is that we see the cache coherency mechanism in play on the first version, which is a black box to me.

    • @thomasq5186
      @thomasq5186 Рік тому

      @@simonracz It's hard to know what actually is happening there. It seems like it consistently varies between two time ranges.
      Also what CPU are you using to get that kind of results? Mine is a Ryzen 9 7900X. My only guess is you have the 7950X (or a threadripper) to get

    • @simonracz
      @simonracz  Рік тому

      Mine is a 5950X.