pjfanning opened a new pull request, #1310:
URL: https://github.com/apache/poi/pull/1310

   ## Summary
   
   Stacked on #1309 (the first two commits here are that PR; this PR adds the 
third). Rebase onto trunk once #1309 is merged and only the 
`poi-ooxml-benchmark` commit remains.
   
   New `poi-ooxml-benchmark` module — kept apart from `poi-benchmark` because 
building `poi-ooxml`/`poi-ooxml-full` is slow. Depends on `poi-ooxml` and on 
`poi-benchmark` for the shared `InvoiceWorkbookBuilder` fixture. Same wiring as 
`poi-benchmark` (me.champeau.jmh, no javadoc/sources/publishing, `jmhJar` in 
the module's `build/libs`); the root module-info verification skip now matches 
any `*benchmark*` jar.
   
   `XSSFFormulaEvaluationBenchmark` is the XSSF counterpart of 
`HSSFFormulaEvaluationBenchmark`: one full pass with a fresh 
`XSSFFormulaEvaluator` per invocation, single-threaded, `rows = 100, 200` × 
`stability = DEFAULT, TOTALLY_IMMUTABLE`. It uses a longer warmup (6×3s) — XSSF 
takes noticeably longer to reach steady state than HSSF, and with the HSSF 
settings the measured iterations were still trending down. 
`TestInvoiceWorkbookXSSF` checks the fixture evaluates without error as an 
`XSSFWorkbook`.
   
   Also: the `jmh {}` blocks in both modules no longer set 
threads/forks/warmup/iterations — the plugin passes those as command-line 
options that override the annotations, which contradicted the comment saying 
the annotations carried the defaults.
   
   Run: `./gradlew :poi-ooxml-benchmark:jmh` or `java -jar 
poi-ooxml-benchmark/build/libs/poi-ooxml-benchmark-<version>-jmh.jar [-prof 
gc]`.
   
   ## First results (Java 17, Apple Silicon, `-prof gc`), HSSF from #1309 for 
comparison
   
   | format | rows | formulas | stability | time/op | alloc/op | per formula |
   |---|---|---|---|---|---|---|
   | XSSF | 100 | 815 | DEFAULT | 13.5 ms | 10.1 MB | 16.6 µs, 12.4 KB |
   | XSSF | 100 | 815 | TOTALLY_IMMUTABLE | 12.6 ms | 9.3 MB | 15.5 µs, 11.4 KB 
|
   | XSSF | 200 | 1615 | DEFAULT | 29.1 ms | 19.6 MB | 18.0 µs, 12.1 KB |
   | XSSF | 200 | 1615 | TOTALLY_IMMUTABLE | 29.8 ms | 18.6 MB | 18.5 µs, 11.5 
KB |
   | HSSF | 100 | 815 | DEFAULT | 2.4 ms | 2.2 MB | 2.9 µs, 2.6 KB |
   | HSSF | 100 | 815 | TOTALLY_IMMUTABLE | 1.7 ms | 1.5 MB | 2.1 µs, 1.9 KB |
   
   - XSSF is ~5.6× slower and allocates ~4.7× more than HSSF for the same 
workbook. XSSF re-parses every formula's text on each pass 
(`XSSFEvaluationWorkbook.getFormulaTokens`) and reads cell values through 
XmlBeans, both of which HSSF avoids.
   - Dependency tracking (`DEFAULT` vs `TOTALLY_IMMUTABLE`) is only ~6% in 
XSSF, versus ~27% in HSSF — it is dwarfed by the per-cell parsing and XML 
access.
   - Scaling 100 → 200 rows: 2.15× time, 1.94× allocation for 1.98× formulas.
   
   ## Test plan
   
   - [x] `./gradlew :poi-ooxml-benchmark:check` (includes 
`TestInvoiceWorkbookXSSF`)
   - [x] `./gradlew :poi-ooxml-benchmark:jmhJar` and a full benchmark run
   - [ ] CI
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to