Episode 4 of a series tackling the 1-billion-row challenge in Java, focused on reading and understanding JVM-generated assembly code. The discussion covers how to extract assembly output from the JVM using the HotSpot disassembler, explains Java's tiered compilation pipeline (interpreter → C1 → C2), and uses Compiler Explorer (Godbolt) to demystify assembly by comparing a simple find-character loop in C against its Java JIT-compiled equivalent. Key takeaway: the JVM's C2 compiler produces roughly the same six-instruction loop as an optimized C compiler, but the surrounding overhead code raises questions about how much extra work runs per call when the function is invoked two billion times.
•47m watch time
Sort: