There is plenty of CPU slack for more threads to do the same thing Going on, and most of it is spent blocking and unblocking threads. The test is running: even with many threads, not much computation is The reason is hard to see from theĭata, but easy to see on a CPU performance meter such as perfbar while It may be somewhat puzzling at first that adding a lot more threadsĭegrades performance only slightly. Increases past ten offer diminishing returns. Increasing buffer size to ten helps dramatically, but Size of one causes very poor throughput this is because each threadĬan make only a tiny bit of progress before blocking and waiting forĪnother thread. The following is an excerpt from the book Java Concurrency in Practice, Chapter 12.2 Testing for Performance where the author talks about throughput of a bounded buffer implementation.įigure 12.1 shows some sample results on a 4-way machine, using bufferĬapacities of 1, 10, 100, and 1000.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |