Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions _posts/2025-10-26-understanding-jmh-java-microbenchmarking.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,20 @@ <h3>Single-Thread Performance (JDK 25)</h3>
<thead>
<tr>
<th>Implementation</th>
<th>Average Time (ns)</th>
<th>Throughput (ops/ns)</th>
<th class="metric-col">Average Time (ns)</th>
<th class="metric-col">Throughput (M ops/s)</th>
</tr>
</thead>
<tbody>
<tr>
<td class="impl-cell highlight-otel">OpenTelemetry</td>
<td class="metric-cell">14.321 ±0.130</td>
<td class="metric-cell">0.069 ±0.001</td>
<td class="metric-cell">69.8 ±0.6</td>
</tr>
<tr>
<td class="impl-cell">UUID</td>
<td class="metric-cell">247.141 ±8.476</td>
<td class="metric-cell">0.004 ±0.001</td>
<td class="metric-cell">4.0 ±0.1</td>
</tr>
</tbody>
</table>
Expand All @@ -159,20 +159,20 @@ <h3>Multi-Thread Performance (10 Threads, JDK 25)</h3>
<thead>
<tr>
<th>Implementation</th>
<th>Average Time (ns)</th>
<th>Throughput (ops/ns)</th>
<th class="metric-col">Average Time (ns)</th>
<th class="metric-col">Throughput (M ops/s)</th>
</tr>
</thead>
<tbody>
<tr>
<td class="impl-cell highlight-otel">OpenTelemetry</td>
<td class="metric-cell">24.967 ±1.525</td>
<td class="metric-cell">0.420 ±0.007</td>
<td class="metric-cell">400.5 ±24.4</td>
</tr>
<tr>
<td class="impl-cell">UUID</td>
<td class="metric-cell">3,761.317 ±65.991</td>
<td class="metric-cell">0.003 ±0.001</td>
<td class="metric-cell">2.7 ±0.1</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -203,6 +203,10 @@ <h3>Multi-Thread Performance (10 Threads, JDK 25)</h3>
text-align: left;
}

.performance-table .metric-col {
width: 33%;
}

.performance-table .metric-cell {
font-family: monospace;
}
Expand Down Expand Up @@ -231,8 +235,8 @@ <h4>1. Single-Thread Analysis</h4>
</li>
<li><strong>Throughput:</strong>
<ul>
<li>OpenTelemetry: 0.069 operations per nanosecond (69 million ops/second)</li>
<li>UUID: 0.004 operations per nanosecond (4 million ops/second)</li>
<li>OpenTelemetry: ~69.8 million ops/second</li>
<li>UUID: ~4.0 million ops/second</li>
</ul>
</li>
</ul>
Expand All @@ -248,8 +252,8 @@ <h4>2. Multi-Thread Analysis (10 Threads)</h4>
</li>
<li><strong>Throughput:</strong>
<ul>
<li>OpenTelemetry: Increases to 0.420 ops/ns (excellent scaling)</li>
<li>UUID: Decreases to 0.003 ops/ns (poor scaling)</li>
<li>OpenTelemetry: Increases to ~400.5 million ops/second (excellent scaling)</li>
<li>UUID: Decreases to ~2.7 million ops/second (poor scaling)</li>
</ul>
</li>
</ul>
Expand All @@ -270,6 +274,10 @@ <h4>3. Key Observations</h4>
</li>
</ul>

<p>
For a complete breakdown of the results across different JDK versions and a deeper analysis of the real-world impact, please see the follow-up post: <a href="/2025/11/15/performance-analysis-trace-id-generation.html">Trace ID Generation: A Performance Analysis of UUID vs. OpenTelemetry</a>.
</p>

<h2>Best Practices</h2>

<p>When writing JMH benchmarks, keep these points in mind:</p>
Expand Down
Loading
Loading