Tagged articles
57 articles
Page 1 of 1
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Dec 10, 2025 · Backend Development

Mastering Java MethodHandle: From Lookup to Performance Benchmarks

This article provides a comprehensive guide to Java MethodHandle, covering its differences from reflection, step‑by‑step creation (Lookup, MethodType, finding handles, invocation), advanced techniques like binding and dropping arguments, array spreading, and a JMH performance comparison with reflection, all demonstrated in a Spring Boot 3.4.2 environment.

JMHJavaMethodHandle
0 likes · 10 min read
Mastering Java MethodHandle: From Lookup to Performance Benchmarks
FunTester
FunTester
Jul 15, 2025 · Backend Development

How to Use JMH for Precise Java Microbenchmarking and Performance Optimization

This article explains microbenchmarking concepts, demonstrates how to use the Java Microbenchmark Harness (JMH) to accurately measure and compare the performance of specific code snippets such as synchronized methods, and provides practical guidance for integrating JMH into Java projects for reliable performance testing and regression analysis.

JMHJavaMicrobenchmarking
0 likes · 11 min read
How to Use JMH for Precise Java Microbenchmarking and Performance Optimization
Architect's Guide
Architect's Guide
Mar 16, 2025 · Backend Development

Understanding Java Object Pooling with Commons Pool 2 and HikariCP: Concepts, Configuration, and Performance Testing

This article explains Java object pooling using Commons Pool 2 and HikariCP, covering their core classes, configuration parameters, practical examples with Redis and JDBC, interview questions, and JMH performance benchmarks that demonstrate significant throughput improvements.

Commons Pool 2Database Connection PoolHikariCP
0 likes · 14 min read
Understanding Java Object Pooling with Commons Pool 2 and HikariCP: Concepts, Configuration, and Performance Testing
Java Architect Essentials
Java Architect Essentials
Dec 25, 2024 · Backend Development

Understanding Java Connection Pools: Commons Pool 2, Jedis, and HikariCP Performance

This article explains the principles of object pooling in Java, introduces the Commons Pool 2 library and its use in Redis client Jedis, compares pool and non‑pool performance with JMH benchmarks, and details the fast HikariCP database connection pool along with configuration tips and interview questions.

Commons-PoolConnection PoolHikariCP
0 likes · 15 min read
Understanding Java Connection Pools: Commons Pool 2, Jedis, and HikariCP Performance
FunTester
FunTester
Jun 4, 2024 · Backend Development

Why FastThreadLocal Beats ThreadLocal in High‑Concurrency Java Apps

This article compares Java's standard ThreadLocal with Netty's FastThreadLocal, explains their internal mechanisms, shows practical code examples, runs a JMH microbenchmark, and discusses performance, memory management, and usage scenarios to help developers choose the right thread‑local storage solution.

FastThreadLocalJMHJava
0 likes · 11 min read
Why FastThreadLocal Beats ThreadLocal in High‑Concurrency Java Apps
Su San Talks Tech
Su San Talks Tech
May 16, 2024 · Backend Development

Does Try‑Catch Inside a Java Loop Really Slow Down Performance?

A developer debates whether placing a try‑catch block inside a Java for‑loop impacts performance, runs JMH benchmarks comparing try‑catch inside the loop versus around it, examines bytecode differences, references Effective Java’s warnings, and concludes the overhead is minimal unless exceptions are actually thrown.

BenchmarkException HandlingJMH
0 likes · 7 min read
Does Try‑Catch Inside a Java Loop Really Slow Down Performance?
FunTester
FunTester
Apr 15, 2024 · Fundamentals

Using JMH to Benchmark GUID Generation Strategies in Java

This article introduces JMH, explains its key features, and presents microbenchmark results comparing thread‑exclusive, thread‑shared, Snowflake, UUID, and Snowflake‑algorithm GUID generation methods under various thread counts, accompanied by the full Java test code.

BenchmarkingGUIDJMH
0 likes · 8 min read
Using JMH to Benchmark GUID Generation Strategies in Java
政采云技术
政采云技术
Jan 25, 2024 · Fundamentals

Java JDK 12‑17 New Features and Enhancements Overview

This article provides a comprehensive overview of the major language and runtime enhancements introduced in JDK 12 through JDK 17, covering switch expressions, micro‑benchmarking with JMH, class‑data sharing, garbage‑collector improvements, new String methods, hidden and sealed classes, records, and unified asynchronous logging, all illustrated with code examples.

Garbage CollectionJDKJMH
0 likes · 23 min read
Java JDK 12‑17 New Features and Enhancements Overview
macrozheng
macrozheng
Aug 24, 2023 · Backend Development

Why Reusing a Single Jackson ObjectMapper Boosts JSON Performance 10×

This article explains how repeatedly creating Jackson ObjectMapper instances hurts performance, demonstrates a JMH benchmark comparing new, singleton, and ThreadLocal ObjectMapper usages, and concludes that a single globally shared ObjectMapper can achieve up to ten times faster JSON parsing.

BenchmarkJMHJackson
0 likes · 8 min read
Why Reusing a Single Jackson ObjectMapper Boosts JSON Performance 10×
Architect's Tech Stack
Architect's Tech Stack
Aug 22, 2023 · Backend Development

Why List.sort() Is Faster Than Stream.sorted() in Java: Benchmarks and Analysis

An in‑depth comparison shows that Java's native List.sort() outperforms Stream.sorted() due to lower overhead, demonstrated through simple demos, JMH micro‑benchmarks across various collection sizes, and analysis of stream processing costs, concluding that the performance gap, while measurable, is often negligible in typical use.

JMHJavalist.sort
0 likes · 11 min read
Why List.sort() Is Faster Than Stream.sorted() in Java: Benchmarks and Analysis
Top Architect
Top Architect
Aug 13, 2023 · Backend Development

Why List.sort() Is Faster Than Stream.sorted() in Java

This article investigates the performance difference between Java's native List.sort() method and the Stream.sorted() approach, provides simple demos, explains JIT warm‑up effects, and presents JMH benchmark results that show List.sort() consistently outperforms Stream.sorted() for typical collection sizes.

BenchmarkJMHJava
0 likes · 11 min read
Why List.sort() Is Faster Than Stream.sorted() in Java
Java Backend Technology
Java Backend Technology
Aug 10, 2023 · Backend Development

Why list.sort() Beats stream().sorted() in Java: Benchmarks and Insights

This article investigates whether Java's list.sort() truly outperforms stream().sorted() by presenting simple demos, explaining the pitfalls of naive timing, and using JMH benchmarks to reveal that list.sort consistently runs faster due to lower overhead, while the performance gap remains small for typical data sizes.

BenchmarkJMHJava
0 likes · 9 min read
Why list.sort() Beats stream().sorted() in Java: Benchmarks and Insights
Java Architect Essentials
Java Architect Essentials
Jun 11, 2023 · Backend Development

Understanding Java Object Pooling: Commons Pool 2, Jedis Integration, and HikariCP Performance

This article explains Java object pooling concepts, introduces the Commons Pool 2 library, demonstrates its use with Redis via Jedis, compares performance with JMH benchmarks, and discusses the high‑performance HikariCP database connection pool, including configuration tips and common interview questions.

Connection PoolHikariCPJMH
0 likes · 15 min read
Understanding Java Object Pooling: Commons Pool 2, Jedis Integration, and HikariCP Performance
Selected Java Interview Questions
Selected Java Interview Questions
Jun 2, 2023 · Backend Development

Java Connection Pooling: Commons Pool 2, Jedis, and HikariCP

This article explains the principles of object pooling in Java, introduces the Commons Pool 2 library, demonstrates its use with Redis client Jedis, compares performance with JMH benchmarks, and discusses the high‑performance HikariCP database connection pool, including configuration tips and interview questions.

Commons-PoolConnection PoolHikariCP
0 likes · 14 min read
Java Connection Pooling: Commons Pool 2, Jedis, and HikariCP
Architect's Tech Stack
Architect's Tech Stack
May 24, 2023 · Backend Development

Understanding Java Connection Pools: Commons Pool 2, Jedis, and HikariCP

This article explains the principles of object pooling in Java, introduces the Commons Pool 2 library, demonstrates its use with Redis client Jedis, compares performance with JMH benchmarks, and details the configuration and advantages of the high‑performance HikariCP database connection pool.

Commons-PoolConnection PoolHikariCP
0 likes · 17 min read
Understanding Java Connection Pools: Commons Pool 2, Jedis, and HikariCP
FunTester
FunTester
Apr 19, 2023 · Backend Development

Performance Comparison of Groovy 'as' Keyword and Java Conversion Methods Using JMH

This article benchmarks the Groovy 'as' type‑conversion keyword against native Java conversion methods for String‑to‑double, double‑to‑String, and double‑to‑int operations using JMH, revealing that Java's built‑in approaches consistently outperform Groovy's 'as' keyword across various test cases.

BenchmarkGroovyJMH
0 likes · 8 min read
Performance Comparison of Groovy 'as' Keyword and Java Conversion Methods Using JMH
Ziru Technology
Ziru Technology
Mar 31, 2023 · Backend Development

Master Java Performance Testing with JMH: From Basics to Advanced Benchmarks

This article explains what benchmarking is, introduces the JMH framework for Java, shows how to add JMH dependencies, walks through a simple "Hello JMH" example with full source and output, demonstrates using JMH with Spring Boot, details the most important options and annotations, and highlights common pitfalls to avoid when writing reliable micro‑benchmarks.

BenchmarkingJMHJava
0 likes · 17 min read
Master Java Performance Testing with JMH: From Basics to Advanced Benchmarks
Su San Talks Tech
Su San Talks Tech
Feb 26, 2023 · Backend Development

Does a try‑catch Inside a Java for‑loop Really Slow Down Your Code?

A practical benchmark compares placing a try‑catch inside a Java for‑loop versus wrapping the loop with try‑catch, revealing that the performance difference is negligible and that the real impact depends on exception frequency and code design rather than the try‑catch placement.

BenchmarkEffective JavaJMH
0 likes · 6 min read
Does a try‑catch Inside a Java for‑loop Really Slow Down Your Code?
Java Architect Essentials
Java Architect Essentials
Feb 21, 2023 · Backend Development

Performance Benchmark of Common Java JSON Libraries Using JMH

This article benchmarks the serialization and deserialization performance of four popular Java JSON libraries—Gson, Fastjson, Jackson, and Json‑lib—using JMH, analyzes the results across different operation counts, and provides guidance on selecting the most suitable library for high‑performance applications.

GsonJMHJSON
0 likes · 11 min read
Performance Benchmark of Common Java JSON Libraries Using JMH
Architect's Tech Stack
Architect's Tech Stack
Feb 16, 2023 · Backend Development

A Comprehensive Guide to Java Microbenchmarking with JMH

This article introduces Java Microbenchmark Harness (JMH), explains why warm‑up is necessary, details common annotations, shows how to set up a Maven project, provides a complete benchmark example comparing LinkedList iteration methods, and demonstrates how to run and interpret the results.

BenchmarkingJMHJava
0 likes · 13 min read
A Comprehensive Guide to Java Microbenchmarking with JMH
Top Architect
Top Architect
Oct 9, 2022 · Backend Development

JMH – Java Microbenchmark Harness: Introduction, Demo, and Annotation Guide

This article introduces JMH, the official Java microbenchmarking tool, explains why warm‑up is needed, shows how to build a Maven project, provides a complete LinkedList iteration benchmark example, demonstrates common JMH annotations, and outlines how to run and interpret benchmark results.

BenchmarkingJMHJava
0 likes · 16 min read
JMH – Java Microbenchmark Harness: Introduction, Demo, and Annotation Guide
Java High-Performance Architecture
Java High-Performance Architecture
Aug 12, 2022 · Backend Development

Mastering Java Connection Pools: From Commons Pool to HikariCP Performance Secrets

This article explains why pooling costly resources like database connections improves performance, introduces the Commons Pool 2 library and its core classes, demonstrates a Jedis pool with JMH benchmarks showing a 5× throughput boost, and dives into HikariCP's optimizations, configuration tips, and common interview questions.

Commons-PoolConnection PoolHikariCP
0 likes · 15 min read
Mastering Java Connection Pools: From Commons Pool to HikariCP Performance Secrets
Architect
Architect
Aug 5, 2022 · Databases

Understanding Object Pooling in Java: Commons Pool 2, HikariCP, and Performance Benchmarks

This article explains Java object pooling concepts, introduces the Commons Pool 2 library and its usage with Redis's Jedis client, compares it with the high‑performance HikariCP database connection pool, and presents JMH benchmark results demonstrating significant throughput gains, while also covering configuration parameters and interview questions.

Commons-PoolDatabase ConnectionHikariCP
0 likes · 15 min read
Understanding Object Pooling in Java: Commons Pool 2, HikariCP, and Performance Benchmarks
Architect's Tech Stack
Architect's Tech Stack
May 1, 2022 · Backend Development

Using JMH for Java Microbenchmarking: A Comprehensive Guide

This article introduces Java Microbenchmark Harness (JMH), explains why warm‑up is needed, walks through project setup with Maven, demonstrates benchmark code for LinkedList iteration, details common JMH annotations, shows how to run and interpret results, and concludes with practical usage tips, while also mentioning a promotional book giveaway.

JMHJavaPerformance Testing
0 likes · 12 min read
Using JMH for Java Microbenchmarking: A Comprehensive Guide
Top Architect
Top Architect
Feb 20, 2022 · Backend Development

Using JMH for Java Microbenchmarking: Demo, Annotations, and Best Practices

This article introduces Java Microbenchmark Harness (JMH), explains why warm‑up is needed, shows how to build a benchmark project with Maven, provides a complete LinkedList iteration benchmark example with all relevant JMH annotations, demonstrates execution commands, and interprets the resulting performance reports.

BenchmarkingJMHJava
0 likes · 13 min read
Using JMH for Java Microbenchmarking: Demo, Annotations, and Best Practices
Java Interview Crash Guide
Java Interview Crash Guide
Feb 18, 2022 · Backend Development

Master Java Microbenchmarking with JMH: From Setup to Results

This article explains how to use JMH for precise Java micro‑benchmarks, covering JVM warm‑up, project setup with Maven, writing benchmark methods, configuring annotations, running tests, interpreting results, and provides practical code examples and tips for reliable performance measurement.

BenchmarkingJMHJVM
0 likes · 13 min read
Master Java Microbenchmarking with JMH: From Setup to Results
JD Retail Technology
JD Retail Technology
Dec 29, 2021 · Backend Development

Microbenchmarking Integer-to-String Conversions in Java Using JMH

This article examines the performance of four Java integer-to-string conversion methods—Integer.toString, String.valueOf, a+"", and ""+a—by conducting raw loop tests and detailed JMH microbenchmarks, analyzing JVM warm-up, JIT, and OSR effects to reveal reliable measurement practices.

JITJMHJava
0 likes · 25 min read
Microbenchmarking Integer-to-String Conversions in Java Using JMH
Java Backend Technology
Java Backend Technology
Jul 27, 2021 · Backend Development

Is System.currentTimeMillis Really a Performance Bottleneck? A Deep Dive with Benchmarks

After observing a middleware that caches System.currentTimeMillis, the author investigates whether this method truly suffers performance issues, debunks common myths with detailed analysis, benchmarks using custom and JMH tests, and concludes that System.currentTimeMillis performs adequately without needing custom caching.

JMHJavaSystem.currentTimeMillis
0 likes · 12 min read
Is System.currentTimeMillis Really a Performance Bottleneck? A Deep Dive with Benchmarks
Senior Brother's Insights
Senior Brother's Insights
Jan 6, 2021 · Backend Development

Master Java Microbenchmarking with JMH: A Hands‑On Guide

This article introduces JMH, the Java Microbenchmark Harness, explains why traditional main‑method benchmarks are unreliable, and provides step‑by‑step instructions, code examples, and best‑practice annotations for accurately measuring method‑level performance in Java applications.

Backend DevelopmentBenchmarkingJIT
0 likes · 20 min read
Master Java Microbenchmarking with JMH: A Hands‑On Guide
Programmer DD
Programmer DD
Nov 16, 2020 · Backend Development

Is System.currentTimeMillis Really a Performance Bottleneck? A Deep Dive

This article investigates whether System.currentTimeMillis suffers from performance problems by examining custom caching implementations, analyzing common misconceptions, presenting benchmark data from both simple loops and JMH tests, and concluding that the native method is sufficiently fast for typical use cases.

BenchmarkJMHJava
0 likes · 13 min read
Is System.currentTimeMillis Really a Performance Bottleneck? A Deep Dive
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Aug 26, 2020 · Backend Development

Testing Volatile Thread Safety and Comparing LongAdder vs AtomicInteger Performance in Java

This article examines the thread‑safety of the volatile keyword under multi‑write scenarios, demonstrates its failure with a concurrent counter test, and benchmarks LongAdder against AtomicInteger using JMH, revealing LongAdder’s superior performance under high contention and AtomicInteger’s advantage in low‑contention environments.

AtomicIntegerJMHJava
0 likes · 8 min read
Testing Volatile Thread Safety and Comparing LongAdder vs AtomicInteger Performance in Java
Sohu Tech Products
Sohu Tech Products
Jun 10, 2020 · Fundamentals

Using JMH for Java Microbenchmarking: A Comprehensive Guide

This article introduces JMH, explains how to add dependencies, write and run microbenchmarks for string concatenation, describes key annotations, highlights common pitfalls, and shows how to package, visualize, and integrate JMH benchmarks within Java projects.

BenchmarkingJMHJVM
0 likes · 14 min read
Using JMH for Java Microbenchmarking: A Comprehensive Guide
macrozheng
macrozheng
May 29, 2020 · Backend Development

Why Switch Beats If‑Else in Java: Up to 3.7× Faster (JMH Benchmark)

This article benchmarks Java's switch statement against equivalent if‑else chains using JMH, explains the underlying bytecode differences, shows how tableswitch and lookupswitch are generated, and demonstrates that switch can be up to 3.7 times faster as the number of branches grows.

JMHJavabytecode
0 likes · 16 min read
Why Switch Beats If‑Else in Java: Up to 3.7× Faster (JMH Benchmark)
Xiao Lou's Tech Notes
Xiao Lou's Tech Notes
May 19, 2020 · Backend Development

Can You Build a Faster Counter Than Java’s LongAdder? A Deep Dive

An in‑depth Java performance study explores LongAdder, compares it with AtomicLong and lock‑based counters using JMH, and walks through successive custom implementations (V0‑V5) that apply striping, modulo optimization, false‑sharing elimination, and advanced hash probing to approach or surpass LongAdder’s throughput.

JMHJava concurrencyfalse sharing
0 likes · 16 min read
Can You Build a Faster Counter Than Java’s LongAdder? A Deep Dive
Xiao Lou's Tech Notes
Xiao Lou's Tech Notes
May 4, 2020 · Backend Development

Mastering JMH: Essential Java Microbenchmark Techniques for Accurate Performance Testing

JMH is a Java harness that enables precise, reproducible microbenchmarking through annotations, state management, threading, and profiling, and this guide walks through its core features—benchmark modes, state scopes, setup/teardown, fork control, blackholes, and advanced options—illustrated with sample code and results.

BenchmarkingJMHJava
0 likes · 18 min read
Mastering JMH: Essential Java Microbenchmark Techniques for Accurate Performance Testing
Ziru Technology
Ziru Technology
Sep 19, 2019 · Backend Development

Why LongAdder Beats AtomicLong in High Contention: Deep Dive into Java’s Concurrent Counter

This article explains how java.util.concurrent.atomic.LongAdder provides a more efficient counting mechanism than AtomicLong under high contention, discusses its trade‑offs in space and precision, presents JMH benchmark results, and walks through the internal implementation details such as cells, CAS loops, and hash‑based distribution.

CASJMHJava
0 likes · 13 min read
Why LongAdder Beats AtomicLong in High Contention: Deep Dive into Java’s Concurrent Counter
Java Captain
Java Captain
Jun 27, 2019 · Backend Development

Performance Benchmark of Common Java JSON Libraries Using JMH

Using JMH, this article benchmarks the serialization and deserialization performance of four popular Java JSON libraries—Gson, Fastjson, Jackson, and Json-lib—by testing various scenarios with a complex Person model, analyzing results, and providing guidance on selecting the most suitable library for high‑performance applications.

GsonJMHJSON
0 likes · 13 min read
Performance Benchmark of Common Java JSON Libraries Using JMH
Java Architecture Diary
Java Architecture Diary
Mar 30, 2019 · Backend Development

Which Java UUID Generator Is Fastest? JMH Benchmark Comparison

This article explains the purpose of UUIDs, common use cases, compares several Java UUID generation libraries, and presents JMH benchmark results showing that the mica implementation based on Java 9 outperforms JDK 8 ThreadLocalRandom and Hutool FastSimpleUUID by three to four times.

BenchmarkJMHJava
0 likes · 4 min read
Which Java UUID Generator Is Fastest? JMH Benchmark Comparison
Programmer DD
Programmer DD
Aug 25, 2018 · Backend Development

Mastering Java Microbenchmarking with JMH: 12 Common Pitfalls and How to Avoid Them

This article introduces Java Microbenchmark Harness (JMH), explains why precise benchmarking matters, and walks through twelve typical testing pitfalls—such as dead‑code elimination, constant folding, loop misuse, fork isolation, method inlining, false sharing, branch prediction, and multithreading—showing how JMH helps developers obtain reliable performance measurements.

BenchmarkJITJMH
0 likes · 25 min read
Mastering Java Microbenchmarking with JMH: 12 Common Pitfalls and How to Avoid Them