ExecutorService's surprising performance break-even point — rules of thumb?

后端 未结 9 2008
臣服心动
臣服心动 2020-12-08 03:10

I\'m trying to figure out how to correctly use Java\'s Executors. I realize submitting tasks to an ExecutorService has its own overhead. However, I\'m surpris

9条回答
  •  无人及你
    2020-12-08 03:34

    You need to somehow group execution, in order to submit larger portions of computation to each thread (e.g. build groups based on stock symbol). I got best results in similar scenarios by using the Disruptor. It has a very low per-job overhead. Still its important to group jobs, naive round robin usually creates many cache misses.

    see http://java-is-the-new-c.blogspot.de/2014/01/comparision-of-different-concurrency.html

提交回复
热议问题