
Java Benchmarking Mistakes That Invalidate Your Results
Common Java benchmarking mistakes: no warmup, dead code elimination, constant folding, single runs, GC noise, wrong machine and misread averages.
Tag
99 posts

Common Java benchmarking mistakes: no warmup, dead code elimination, constant folding, single runs, GC noise, wrong machine and misread averages.

Build JSF Facelets templates with ui:composition and ui:insert, include fragments with ui:include and write reusable composite components with cc:interface.

Covariant return types in Java: how an override can narrow the return type, what bridge methods the compiler generates and the stack trace effects.

API versioning strategies compared: URL path, header, media type and query versions, the cost of each and how to avoid new versions.

The Spring self invocation problem explained: why calls inside a bean skip the proxy, how it breaks Transactional, Async and Cacheable, and the fixes.

The five SOLID principles in Java with a small order-processing example for each, the symptoms they fix and where applying them becomes overengineering.

Compare ScopedValue and ThreadLocal in Java 25: immutability, bounded lifetime, inheritance by forked tasks, memory cost with virtual threads and migration.

Java generics explained: type parameters, generic methods, bounds, type erasure, invariance and wildcards, with examples and the limits erasure imposes.

Spring transaction management explained: the Transactional annotation, the proxy and manager, propagation, rollback rules and common pitfalls.

Structure a Spring Boot application with ports and adapters so the domain has no framework imports, with an order example, package layout and tests.

Reproduce lost updates and check then act races in Java, learn the patterns that signal a race, fix them with atomics and locks and test for them under load.

Build truly immutable Java classes with final fields, defensive copies and records, and see why shallow immutability fails and why it is thread safe.