@W-23545283 native lib benchmarks#137
Open
andres-rad wants to merge 13 commits into
Open
Conversation
…runtime dep, no version skew)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a language-agnostic benchmark harness for the DataWeave native-lib Node wrapper under a new top-level
benchmarks/directory. It measures four metrics — cold-start, first-run (compile+exec), warm steady-state, and streaming throughput — emits results in a shared JSON schema, and renders a comparison report. Architected so future Python and Scala-engine runners plug in unchanged.W-23545283.
How it works
benchmarks/corpus/— the shared contract every runner consumes:manifest.json(each case has an immutableid, a.dwlscript, optional inputs, and an explicitmetrics[]), 6 scripts, committed inputs, and a deterministic large-input generator.benchmarks/schema/result.schema.json— the JSON schema all runners' output conforms to (envcarriesweaveVersion/commit/dwlibBuildIdfor attribution).benchmarks/lib/— dependency-free helpers:stats(percentiles + MB/s),manifest(load/validate + fail-fast orphan-id check),env(env stamp).benchmarks/runners/node/— the reference runner: in-process warm/streaming (warm-bench), a fresh-process spawn harness for cold-start/first-run (coldstart), andemit(orchestrate → validate ids → write result JSON).benchmarks/report/report.mjs— joins result files by caseid, renders a case×metric table with a Δ-vs-baseline column and a weave-version skew banner; dedupes to the latest result per runner.--emitis a reserved exporter seam.native-lib:benchmarkGradle task — opt-in via-Pbenchmark=true, off by default (never in the normal build/test path).Design decisions
process.hrtime.bigint()sampling harness (not vitestbench) so a future JVM-engine harness can mirror the exact methodology for a fair cross-surface comparison.first-runis measured in the spawn harness (fresh process = genuine cold compilation).env.commit/dwlibBuildId+ immutableid+ the--emitseam in place so it's a bolt-on.Testing
node --testacrossbenchmarks/**/*.test.mjs), including integration tests that drive the real native library../gradlew native-lib:benchmark -Pbenchmark=true, exit 0) — buildsdwlib, runs all four metrics, renders the report. Numbers are reproducible run-over-run (~1–3% variance).Out of scope (follow-ups)
runners/python/).data-weaverepo (depends onDataWeaveScriptingEngine); reads this corpus + emits this schema. Deserves its own spec (JVM cold-start/JIT-warmup methodology).Design spec and implementation plan are included under
docs/superpowers/.