Nitsan Wakart writes about low-latency Java, JVM performance, profiling, and concurrent queues, with a focus on mechanical sympathy.
Commenters recommend it as a great resource on concurrency and the memory system, noting it hasn't been updated since 2018 but remains valuable.
Here are a bunch of blogs from my RSS reader that I think are worth reading. Some of them haven't updated in a while, but the archives may be worth a look anyway.
* Blogs with a math focus:
http://blog.sigfpe.com
http://bit-player.org
http://mathr.co.uk/blog/
https://www.johndcook.com/blog/
* Blogs with a programming languages focus:
https://existentialtype.wordpress.com
https://bluishcoder.co.nz
http://blog.ezyang.com
http://akkartik.name
http://lambda-the-ultimate.org
http://mrale.ph
* Blogs with a UI design focus:
http://www.brandonwalkin.com/blog/
http://ignorethecode.net/blog/
http://interuserface.net
* Blogs with a graphics / 3D rendering focus:
http://c0de517e.blogspot.com
http://diaryofagraphicsprogrammer.blogspot.com
https://directtovideo.wordpress.com
http://graphicrants.blogspot.com
http://www.reedbeta.com
http://www.realtimerendering.com/blog/
https://blog.demofox.org
http://eelpi.gotdns.org/blog.wiki.html
* Other interesting / more general programming blogs (many of these have a "systems" focus):
http://danluu.com
http://ewontfix.com
http://chneukirchen.org/blog/
http://neverworkintheory.org
http://apenwarr.ca/log/
https://www.snellman.net/blog/
https://www.pvk.ca
http://psy-lob-saw.blogspot.com
https://randomascii.wordpress.com
http://fastcompression.blogspot.com
https://fgiesen.wordpress.com
http://blog.plover.com
http://chneukirchen.org/trivium/
http://rachelbythebay.com/w/
If you like Go I have written a ringbuffer library here
https://github.com/fmstephe/flib
have a look in queues/spscq. spsc here stands for single producer, single consumer.
I gave a talk in London about these queues here
https://skillsmatter.com/skillscasts/6163-high-performance-single-producer-single-consumer-in-memory-queue
-------------------
But all of this work is based on the work, and teaching, of Martin Thomson.
Martin Thomson has published a large collection of data structures (which probably include these ringbuffers (I haven't checked specifically))
https://github.com/real-logic/Agrona
If you are near Ireland I highly recommend Martin Thomson's concurrency course
http://instil.co/courses/writing-concurrent-code-with-lock-free-algorithms/
----------
I highly recommend Nitsan Wakart's blog. He covers a lot of interesting ground, all in Java. Probably best to start at the early blog posts and work your way forward.
http://psy-lob-saw.blogspot.co.uk/
Nitsan contributes to a very focused java library here
https://github.com/JCTools/JCTools
This is already a standard piece of how JITs work today. See the discussion of Java intrinsics and Array.fill() here [0].
> An intrinsic function is applied as a method substitution [...] and the compiler will replace it's apparent source-level implementation with a pre-cooked implementation. In some cases intrinsics are sort of compilation cheats [...]
> The intrinsics are all set up in vmSymbols.hpp and if you look, you'll see Arrays.fill is NOT on the list. [...] Because it is something like an intrinsic... [...] What is it then? Arrays.fill is a code pattern substitution kind of compiler shortcut, basically looking for this kind of loop:
```
for (int i = 0; i < arrayB.length; i++) {
arrayB[i] = b;
}
```
And replacing it with a call into the JVM memset implementation.
[0]: http://psy-lob-saw.blogspot.com/2015/04/on-arraysfill-intrinsics-superword-and.html
I just read this: http://psy-lob-saw.blogspot.com/2015/12/safepoints.html
Wow, I had no idea how bad sampling profilers are on JVM. And apparently JVM profiling in general. So collecting a stack trace sample requires a thread being suspended at a safepoint. And a global safepoint requires suspending all threads? Sampler that needs to do that will surely not only miss real CPU time consumer but also significantly alter performance behavior.
Instrumentation is indeed often a pretty bad option as well.
Is it possible to resolve JVM stack traces captured from kernel side (Windows and Linux have mechanisms for this)? That would certainly get around any safepoint restrictions, right?
I know that profiling using VisualVM (or most other profilers) can substantially change the garbage collection behavior of an application (http://psy-lob-saw.blogspot.com/2014/12/the-escape-of-arraylistiterator.html).
I don't know if using VisualVM in the way this article does has the same effect--sounds like the author is not doing any actual profiling, so it may not be an issue. Additionally, since this is a synthetic benchmark, you might argue that it's not important. Still, I'd tend to think it makes more sense to use OS level tools to monitor the CPU usage and avoid changing the behavior of the JVM.
> Matt Warren's blog is great to learn about the internal mechanism of .Net
Yeah I do seem to write alot about .NET internals, but I just seem to keep finding cool stuff in there!!
> I wonder if there is any similar blog for JVM world,
Another Java-based blog I like reading is http://psy-lob-saw.blogspot.co.uk/, I've definitely taken some inspiration from there and written .NET equivalents of his posts.