How difficult can it be to write efficient code?
summary
Shows concrete techniques: use AsyncProfiler flame graphs to find hot allocation sites, then isolate code with JMH microbenchmarks to compare variants. Live demos show a naïve stream-and-concat solution, a StringBuilder that performs worse unless reused, and a hand-rolled single-pass sanitizer for Quarkus config lookup that cuts allocations roughly in half. Measured wins include lower JVM/native memory and a native-image cold start drop from ~25ms to ~16ms. Includes practical tips on measuring, warming, and focusing on the biggest hotspots.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 3:30Premature optimization myths
- 8:54Performance with async-profiler
- 13:36Microbenchmarking with JVM harness
- 24:22Quarkus optimizations
- 31:47Optimizing config matching
- 38:25Optimizations in native images
- 40:32Tools and mindset for performance
- 44:45Key takeaways and closing remarks
related talks
45mHow difficult can it be to write efficient code?
38mMemory Efficient Java
39mMemory Efficient Java
53mFrom functional programming to assembly - the cost of abstractions....
21mMemory Efficient Java
51mZero Waste, Radical Magic, and Italian Graft – Quarkus Efficiency Secrets
59mMaximizing performance with GraalVM
01h 03mKeeping Your Java Hot.
