Top all-time · #2853
Psychosomatic, Lobotomy, Saw
Personal blog · psy-lob-saw.blogspot.comprogrammingsystems
Psychosomatic, Lobotomy, Saw is a personal blog at psy-lob-saw.blogspot.com about programming and systems. Since 2013, 26 different Hacker News readers have linked it 55 times, most often “What a difference a JVM makes?”. The last post was in 2018, but the archive is still widely read.
Blog on Java, Performance, Concurrency, NIO, Unsafe, Low latency, Programming, Software, Philosophy
Most-linked posts?
- What a difference a JVM makes?4 people · 4 mentions · first linked 2018-01-05
- The Escape of ArrayList.iterator()4 people · 4 mentions · first linked 2015-03-07
- Most Sampling Java Profilers Are Terrible3 people · 4 mentions · first linked 2016-02-24
- The Mythical Modulo Mask (2014)2 people · 3 mentions · first linked 2014-11-03
- JMH Perfasm Explained: Looking at False Sharing on Conditional Inlining2 people · 3 mentions · first linked 2015-07-27
- Expanding the Queue Interface: Relaxed Queue Access2 people · 3 mentions · first linked 2015-10-20
- Safepoints: Meaning, Side Effects and Overheads (2015)2 people · 2 mentions · first linked 2016-06-13
- How to Examine and Verify your Java Object Memory Layout2 people · 2 mentions · first linked 2013-05-21
- How Inlined Code Makes for Confusing Profiles2 people · 2 mentions · first linked 2018-07-11
- /2 people · 2 mentions · first linked 2014-03-30
What Hacker News says?
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.…
Comment linking /
on “Ask HN: What programming blogs do you follow?”Submitted 135M messages a second between processes in Java (2013) as a story · 262 points
HN discussion> How do you avoid too many allocations to happen in Java? Most of the time you don't need to, because GCs are that good, and escape analysis can avoid heap allocation automatically[1]. You won't get C++ latency, but you'll do better than Go. If you really need to avoid allocations for some reason, you can go off-heap for C++ performance (Java HFT applications do that for the most performance-critical things; it req…
Comment linking /2014/12/the-escape-of-arraylistiterator.html
on “The ups of downs of porting 50k lines of C++ to Go”Submitted Most Sampling Java Profilers Are Terrible as a story · 54 points
HN discussionAre you familiar with JMH's perfasm? http://psy-lob-saw.blogspot.com/2015/07/jmh-perfasm.html And for profiling apps on production, I've yet to encounter a more thorough, low-overhead profiler than Java Flight Recorder.
Comment linking /2015/07/jmh-perfasm.html
on “Go GC: Prioritizing low latency and simplicity”Submitted Notes on False Sharing as a story · 41 points
HN discussionThe OpenJDK JVM (aka Hotspot) addresses both issues: control [1] and monitoring [2] (there are built-in compilation and deoptimization events emitted to the event stream). You can also compile methods in advance [3], and inspect the generated machine code when benchmarking [4]. You can even compile an entire application ahead-of-time [5] to produce a native binary. [1]: https://docs.oracle.com/en/java/javase/14/vm/c…
Comment linking /2015/07/jmh-perfasm.html
on “JITs are un-ergonomic”Submitted Notes On Concurrent Ring Buffer Queue Mechanics as a story · 41 points
HN discussionVanilla Java is a great resource. The work that Chronicle does got me into low latency Java as well (not doing java now though). Some other great resources I used: * http://psy-lob-saw.blogspot.com/ - Not updated since 2018, but still great stuff in there * https://richardstartin.github.io/ - A few posts per year. Richard does a lot of interesting things.
Comment linking /
on “JVM Anatomy Quark #10: String.intern (2019)”Submitted How Inlined Code Makes for Confusing Profiles as a story · 27 points
HN discussionCan confirm -- writing data to memory is incredibly fast. It's faster to use a lock-free queue and use CAS to insert data though: http://psy-lob-saw.blogspot.com/2016/12/linked-array-queues-... I've benchmarked code myself, and the flamegraphs will barely show the SpscArrayQueue in the profile.
Comment linking /2016/12/linked-array-queues-part-2-spsc.html
on “Good Logging”Submitted The Escape of ArrayList.iterator() as a story · 20 points
HN discussionThis 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 loo…
Comment linking /2015/04/on-arraysfill-intrinsics-superword-and.html
on “Are “jets” a good idea? (2017)”Submitted JMH Perfasm Explained: Looking at False Sharing on Conditional Inlining as a story · 13 points
HN discussionJust as an aside, sometimes slicing up your arrays-of-structs into structs-of-arrays brings big locality improvements. Anyway, you can usefully control some aspects of how Java lays out your data, including primitive fields: http://psy-lob-saw.blogspot.com/2013/05/know-thy-java-object...
Comment linking /2013/05/know-thy-java-object-memory-layout.html
on “Data-Oriented Hash Table”Submitted The Mythical Modulo Mask (2014) as a story · 12 points
HN discussionI 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 al…
Comment linking /2015/12/safepoints.html
on “Java StringBuffer and StringBuilder performance”Submitted On Arrays.fill, Intrinsics, SuperWord and SIMD Instructions as a story · 11 points
HN discussionI 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-arrayl... ). 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 benchm…
Comment linking /2014/12/the-escape-of-arraylistiterator.html
on “Comparing Java GC Collectors”Submitted Wait for It: Counted/Uncounted Loops, Safepoints and OSR Compilation as a story · 8 points
HN discussionFor all those interested in this subject, I'd like to recommend Nitsan Wakart's blog, http://psy-lob-saw.blogspot.com/ , which is dedicated to mechanical sympathy relating to concurrency and the memory system.
Comment linking /
on “The Cache and Multithreading”Submitted Expanding the Queue Interface: Relaxed Queue Access as a story · 7 points
HN discussionAh shoot, you're right this wouldn't be what I'm thinking. I was thinking of "GC Nepotism" [1]. That's the case where an object in old gen pointing to an object in new gen will automatically promote that new gen object into old gen. This can be particularly problematic with graph structures. [1] https://psy-lob-saw.blogspot.com/2016/03/gc-nepotism-and-lin...
Comment linking /2016/03/gc-nepotism-and-linked-queues.html
on “Tune Code Before Your Garbage Collector”Submitted HdrHistogram: A better latency capture method as a story · 7 points
HN discussionSubmitted The JVM Write Barrier – Card Marking as a story · 7 points
HN discussionSubmitted Degrees of Lock/Wait Freedom as a story · 5 points
HN discussionSubmitted The Mythical Modulo Mask as a story · 5 points
HN discussionSubmitted What a difference a JVM makes? as a story · 4 points
HN discussionSubmitted GC 'Nepotism' and Linked Queues as a story · 4 points
HN discussionSubmitted Notes on Concurrent Ring Buffer Queue Mechanics as a story · 4 points
HN discussion