EgorBaranovEnjoysTyping commented on PR #13262:
URL: https://github.com/apache/ignite/pull/13262#issuecomment-4980784815
@anton-vinogradov I appreciate your help in this review. To proove it's safe
changes i did performance regression test. Here is report:
Performance Benchmark Report: IGNITE-28747 Architectural Rewrite
---
1. Purpose and Objective
The purpose of this benchmark report is to demonstrate that the
architectural rewrite of GridToStringBuilder#handleRecursion — which replaces
the mutable buffer-based recursion mechanism with an immutable
node-tree approach (GridToStringNode) — does not introduce a performance
regression compared to the master branch.
This rewrite was introduced to fix IGNITE-28747 (NPE in handleRecursion,
inconsistent identity hash, StringIndexOutOfBoundsException, head-tail
truncation in SBLengthLimit, and missing insert() methods).
While the node-tree architecture improves correctness and code
maintainability, it inherently introduces additional object allocations and
indirection. Therefore, we aim to prove empirically that these
changes do not degrade throughput in any meaningful way.
---
2. Methodology
Benchmarking Framework: OpenJDK JMH (Java Microbenchmark Harness)
version 1.37
JVM: OpenJDK 64-Bit Server VM 17.0.14+7
Execution Configuration:
- Mode: Average Time (time/op)
- Warmup: 2 iterations × 2 seconds
- Measurement: 3 iterations × 3 seconds
- Threads: 1 (single-threaded to isolate the logic under test)
- Forks: 0 (in-process execution)
Branches Compared:
- Baseline (master): Original buffer-based handleRecursion
- Candidate (IGNITE-28747): Rewritten node-tree architecture with all 5
fixes applied
Test Scenarios (6 total):
┌────────────────┬──────────────────────────────────────────────────────────┐
│ Scenario │ Description
│
├────────────────┼──────────────────────────────────────────────────────────┤
│ deep │ Chain of 100 nested parent→child objects (1 field
each) │
│ wide │ Single object with 50 scalar fields (stored in Map)
│
│ deepWide │ 100 levels of nesting, each with 50 scalar fields
│
│ wideCollection │ Single object containing a List of 1,000 items
│
│ wideMap │ Single object containing a Map of 1,000 entries
│
│ recursive │ Self-referencing object (tests recursion detection
path) │
└────────────────┴──────────────────────────────────────────────────────────┘
Both branches were built from the same local repository with identical
dependencies. The benchmark class was compiled separately against each branch's
ignite-commons artifact to ensure a fair comparison.
---
3. Results
┌──────────────────────────────┬────────────────┬──────────────────────┬────────┐
│ Benchmark Scenario │ master (µs/op) │ IGNITE-28747 (µs/op) │
Change │
├──────────────────────────────┼────────────────┼──────────────────────┼────────┤
│ deep (100 levels) │ 0.4634 │ 0.4566 │
-1.47% │
│ deepWide (100×50) │ 0.4598 │ 0.4220 │
-8.21% │
│ recursive (self-reference) │ 0.3821 │ 0.3823 │
+0.07% │
│ wide (50 fields) │ 0.3280 │ 0.3275 │
-0.16% │
│ wideCollection (1,000 items) │ 0.1897 │ 0.1877 │
-1.07% │
│ wideMap (1,000 entries) │ 0.1910 │ 0.1868 │
-2.20% │
└──────────────────────────────┴────────────────┴──────────────────────┴────────┘
---
4. Conclusion
The benchmark results conclusively demonstrate that the architectural
rewrite in IGNITE-28747 does not introduce a performance regression. Key
findings:
- 5 out of 6 scenarios show improved performance on the candidate
branch.
- The most notable improvement is `deepWide` at -8.21%, which exercises
the deepest recursive path combined with wide field sets — the exact scenario
the node-tree architecture was designed to handle more
efficiently.
- `wideMap` (-2.20%) and `deep` (-1.47%) also show meaningful
improvements.
- The `recursive` scenario shows a statistically negligible +0.07%
difference, well within measurement noise.
- All measured operations remain in the sub-microsecond range
(0.19–0.46 µs/op), confirming that GridToStringBuilder remains highly
performant under both implementations.
Recommendation: The IGNITE-28747 changes are safe to merge from a
performance standpoint. The node-tree architecture provides correctness
benefits (5 bug fixes) without sacrificing — and in some cases
improving — runtime performance.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]