Skip to content

perf(fsst): add JavaVsJniFsstBenchmark baseline#292

Merged
dfa1 merged 1 commit into
mainfrom
perf/fsst-benchmark
Jul 20, 2026
Merged

perf(fsst): add JavaVsJniFsstBenchmark baseline#292
dfa1 merged 1 commit into
mainfrom
perf/fsst-benchmark

Conversation

@dfa1

@dfa1 dfa1 commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

Pulled forward from PR 7 of the #287 FSST rewrite sequence, per request, so we have a "before" baseline to compare against as the rest of the rewrite lands — the "arc from slow to fast."

  • New JavaVsJniFsstBenchmark: writes/reads a synthetic high-cardinality Utf8 log-line column (1M rows) that the cost-based dispatch naturally routes through vortex.fsst. @Setup verifies via the inspector that vortex.fsst was actually selected, so a future dispatch change can't silently turn this into a no-op benchmark of another encoding.
  • Exercises the existing, unmodified vortex.fsst writer/reader adapters — they don't change until PR 5 of the sequence — so re-running this identical benchmark after the rewrite lands shows the arc with zero benchmark-code changes.

Baseline measured (JDK 25, Apple silicon, Throughput, -f 1, 5 iters — single-fork, so treat as indicative; will re-run at -f 3 for the final post-rewrite comparison per this project's own JMH noise guidance):

Benchmark ops/s vs JNI
javaFsstEncode 0.085 ± 0.001 ~36x slower
jniFsstEncode 3.024 ± 0.011
javaFsstDecode 5.243 ± 1.146 ~6.5x slower
jniFsstDecode 33.930 ± 0.494

The encode gap is dominated by the current sequential 8-probe longestMatch — exactly what PR 2 (already merged) targets once wired in via PR 5.

Test plan

  • ./mvnw verify -pl performance -am -DskipTests — checkstyle/javadoc clean
  • Full JMH run, all four methods, numbers above

🤖 Generated with Claude Code

Captures the pre-rewrite baseline for issue #287's FSST rewrite. The benchmark
writes/reads a single high-cardinality Utf8 log-line column (1M rows across 20
chunks) that the cost-based dispatch routes through vortex.fsst — @setup asserts
via the inspector that vortex.fsst was actually selected, so a future dispatch
change can't silently turn this into a no-op measurement of another encoding.

It exercises the existing, unmodified vortex.fsst writer/reader adapters (which
don't change until PR 5 of the #287 sequence), so re-running the identical
benchmark after the rewrite lands shows the "arc" from slow to fast with zero
benchmark-code changes.

Measured baseline (JDK 25, Apple silicon, Throughput, -f 1, 5 iters):

  javaFsstEncode   0.085 ± 0.001  ops/s
  jniFsstEncode    3.024 ± 0.011  ops/s   (Java ~36x slower at encode)
  javaFsstDecode   5.243 ± 1.146  ops/s
  jniFsstDecode   33.930 ± 0.494  ops/s   (Java ~6.5x slower at decode)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dfa1
dfa1 merged commit 1003a67 into main Jul 20, 2026
6 checks passed
@dfa1 dfa1 mentioned this pull request Jul 20, 2026
@dfa1
dfa1 deleted the perf/fsst-benchmark branch July 20, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant