Will multi threading provide any performance boost?

前端 未结 19 829
说谎
说谎 2021-02-05 13:49

I am new to programming in general so please keep that in mind when you answer my question.

I have a program that takes a large 3D array (1 billion elements) and sums up

19条回答
  •  独厮守ぢ
    2021-02-05 13:57

    If you're partitionning your data correctly then yes, you will have a boost in performance. If you check your cpu usage right now, one core will be at 100% and the 3 others should be close to 0%

    It all depends on how well you structure your threads and memory usage.

    Also, do not expect a x4 improvement. x4 is the maximum achievable, it will always be lower than that depending on a lot of factors.

提交回复
热议问题