Degrading performance when increasing number of cores

前端 未结 3 1032
别那么骄傲
别那么骄傲 2021-02-07 20:36

My mac is armed with 16 cores.

System.out.println(Runtime.getRuntime().availableProcessors());  //16

I\'m running the code below to see the eff

3条回答
  •  难免孤独
    2021-02-07 20:50

    I added this as a comment, but I'm going to throw it in there as answer too. Because your test is doing file I/O, you have probably hit a point with that 6th thread where you are now doing too much I/O and thus slowing everything down. If you really want to see the benefit of the 16 cores you have, you should re-write your file reading thread to use non-blocking I/O.

提交回复
热议问题