tag:blogger.com,1999:blog-5171098727364395242.post8779503738042173949..comments2023-05-14T13:23:31.669+01:00Comments on Psychosomatic, Lobotomy, Saw: JAQ: Using JMH to Benchmark SPSC Queues Latency - Part INitsanhttp://www.blogger.com/profile/10496299147100350513noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-5171098727364395242.post-76582754765959735912014-11-22T01:04:15.031+00:002014-11-22T01:04:15.031+00:001. Yes it would be simpler, but also less represen...1. Yes it would be simpler, but also less representative of a long lived queue behaviour, which most queues are. It would also add potential GC overhead which I'm not interested in measuring. We must empty the queues to handle the case where an iteration has ended before the queue was cleared.<br />2. The queues are SPSC (single producer, single consumer) queues, so it is technically not valid to swap queues between threads.<br />3. The 'link' measurement is for the thread piping the events back to the originator. Most of the time it finds nothing on the queue, os it is mostly spinning. The number produced is not very meaningful. JMH does not support the measurement you describe at this time. Nitsanhttps://www.blogger.com/profile/10496299147100350513noreply@blogger.comtag:blogger.com,1999:blog-5171098727364395242.post-71825466173156101462014-11-22T00:58:39.283+00:002014-11-22T00:58:39.283+00:00Thanks, glad you find the posts helpful.
There'...Thanks, glad you find the posts helpful.<br />There's plenty of room for improvement in these blog posts, but there's also a limit to the amount of time I can spend writing them... so yes, diagrams might help, but they take me a long time to produce so I gave up on them at the time.<br />"it would have been nice if you had also benchmarked the edge case" - what edge case are you refering to?Nitsanhttps://www.blogger.com/profile/10496299147100350513noreply@blogger.comtag:blogger.com,1999:blog-5171098727364395242.post-848527195157767432014-11-21T18:28:30.158+00:002014-11-21T18:28:30.158+00:00A few questions:
1) Why do you have to clear the q...A few questions:<br />1) Why do you have to clear the queue at tear down? wouldn't it be simpler to just create a new queue chain per iteration in the setup method?<br />2) Why is it important for each thread to keep their in/out queues per iteration? why does it matter for your benchmark?<br />3) The link benchmark appears to be individual time in-between queues. Why aren't you also measuring the individual time in the queues? that is the time interval between a T[K] right/put and a T[k+1] read/poll?Niltonhttps://www.blogger.com/profile/10040778971092115938noreply@blogger.comtag:blogger.com,1999:blog-5171098727364395242.post-88994112233269452072014-11-21T16:50:01.317+00:002014-11-21T16:50:01.317+00:00I generally consider your blog posts very informat...I generally consider your blog posts very informative. One suggestion though: add pictures/diagrams! It's much easier for a reader to understand your benchmarks, particularly when they are complicated like this one here, if you add diagrams/pictures. Also, it would have been nice if you had also benchmarked the edge case. What's an SPSC? Again, help you readers read your blog post. Niltonhttps://www.blogger.com/profile/10040778971092115938noreply@blogger.comtag:blogger.com,1999:blog-5171098727364395242.post-62371950656748179882014-06-29T17:18:35.374+01:002014-06-29T17:18:35.374+01:00Will fix shortly.
JAQ was renamed to JCTools recen...Will fix shortly.<br />JAQ was renamed to JCTools recently (soon to be maven released).<br />Here's the link: https://github.com/JCTools/JCTools/blob/cb1ecc1f103d57a72c7c167efc15cf610b846d3d/jctools-benchmarks/src/main/java/org/jctools/jmh/latency/spsc/RingBurstRoundTripWithGroups.javaNitsanhttps://www.blogger.com/profile/10496299147100350513noreply@blogger.comtag:blogger.com,1999:blog-5171098727364395242.post-63690772639526627502014-06-29T14:07:03.106+01:002014-06-29T14:07:03.106+01:00Nitsan, great post however the link to full code i...Nitsan, great post however the link to full code is broken. Can you please fix it.<br /><br />Cheers<br />Anonymousnoreply@blogger.com