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
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@ kotlin-js-store
.claude
docs
AGENTS.md
.impeccable/
DESIGN.md
design.md
performance/.benchmark.lock
performance/kompress-baseline/
performance/smoke-runs/
performance/kompress-baseline/*/smoke.json
performance/kompress-baseline/*/smoke-raw/
137 changes: 0 additions & 137 deletions .impeccable/design.json

This file was deleted.

43 changes: 43 additions & 0 deletions BENCHMARKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,46 @@ throughputMiBPerSecond = originalSizeBytes / 1,048,576 / averageSeconds

Record the Git commit, machine, operating system, JDK, Node version, and system load with any published result.
The cleaned JSON retains environment fields present in the source reports, but it cannot detect thermal throttling or competing processes.

## Choose which library to measure

The default is `both`. Select one library while developing:

```sh
./gradlew :kflate:benchmarkAll -PbenchmarkLibrary=kflate
./gradlew :kflate:benchmarkAll -PbenchmarkLibrary=kompress
./gradlew :kflate:benchmarkAll -PbenchmarkLibrary=both
```

The same property applies to individual platform tasks and smoke tasks, for example
`:kflate:jvmBenchmarkSmokeBenchmark -PbenchmarkLibrary=kompress`.
Only the selected library is timed. Setup still creates both libraries' streams
and validates the selected decoder against them, outside the timed operation.
No saved binary fixtures are required.

Single-library runs produce the usual timestamped Markdown and JSON reports,
with the unmeasured library shown as unavailable. Reports record the selected
libraries, runner environment, measured commit, and report host. When reporting
an archived run, pass `--benchmark-commit`; the report host is the machine
generating the report, which may differ from the benchmark machine.
They validate every expected
case for the selected library and never replace `performance/latest.json`.
When generating a report manually, pass the matching `--library kflate` or
`--library kompress` to `scripts/benchmark_comparison.py`.

Retain the generated reports before starting another full run, which clears the
raw build reports. For reproducibility, also copy the raw report directory and
`kflate/performance/benchmark-metadata.jsonl` into an archive and record the
measured commit, machine/CPU, OS, JDK, Node, and benchmark configuration.
Use saved Kompress timings as a development reference. Rerun both libraries on
the same machine for published comparisons after runtime or hardware changes.

## Retained level benchmarks

`performance/history.json` and `performance/runs/2026-09-08-kflate-levels/`
are a static archive of the previous level 0–9 experiment. The history JSON
includes the Kompress measurements and their host, dependency, source, and
fixture hashes. The platform directories retain the KFlate raw reports and logs.
These files remain available for inspection; the current runner does not update
them or require the old fixture cache. Their level matrix differs from the
restored level-6 suite, so the comparison script does not ingest them.
129 changes: 0 additions & 129 deletions DESIGN.md

This file was deleted.

16 changes: 15 additions & 1 deletion kflate/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ kotlin {
}
}

val benchmarkLibrary = providers.gradleProperty("benchmarkLibrary").getOrElse("both")
require(benchmarkLibrary in setOf("kflate", "kompress", "both")) {
"benchmarkLibrary must be kflate, kompress, or both"
}
val benchmarkInclude = when (benchmarkLibrary) {
"kflate" -> ".*\\.CompressionBenchmarks\\..*"
"kompress" -> ".*\\.KompressBaselineBenchmarks\\..*"
else -> ".*"
}

benchmark {
targets {
register("jvmBenchmark")
Expand All @@ -124,6 +134,7 @@ benchmark {

configurations {
named("main") {
include(benchmarkInclude)
warmups = 8
iterations = 15
iterationTime = 1
Expand All @@ -132,6 +143,7 @@ benchmark {
advanced("jvmForks", 3)
}
register("smoke") {
include(benchmarkInclude)
warmups = 1
iterations = 1
iterationTime = 1
Expand Down Expand Up @@ -244,8 +256,10 @@ tasks.register<Exec>("benchmarkComparison") {
"scripts/benchmark_comparison.py",
"--metadata",
"kflate/performance/benchmark-metadata.jsonl",
"--publish-latest",
"--library",
benchmarkLibrary,
)
if (benchmarkLibrary == "both") args("--publish-latest")
}

mavenPublishing {
Expand Down
12 changes: 12 additions & 0 deletions performance/full-suite.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Running :kflate:jvmBenchmarkBaselineBenchmark; log: /home/rafael/.cache/kflate-benchmark-levels/performance/kompress-baseline/jvm/raw/benchmark.log
Saved 140 measurements to /home/rafael/.cache/kflate-benchmark-levels/performance/kompress-baseline/jvm/raw
Running :kflate:linuxX64BenchmarkBaselineBenchmark; log: /home/rafael/.cache/kflate-benchmark-levels/performance/kompress-baseline/linuxX64/raw/benchmark.log
Saved 140 measurements to /home/rafael/.cache/kflate-benchmark-levels/performance/kompress-baseline/linuxX64/raw
Running :kflate:wasmJsBenchmarkBaselineBenchmark; log: /home/rafael/.cache/kflate-benchmark-levels/performance/kompress-baseline/wasmJs/raw/benchmark.log
Saved 140 measurements to /home/rafael/.cache/kflate-benchmark-levels/performance/kompress-baseline/wasmJs/raw
Running :kflate:jvmBenchmarkBenchmark; log: /home/rafael/.cache/kflate-benchmark-levels/performance/runs/2026-09-08-kflate-levels/jvm/benchmark.log
Saved 140 measurements to /home/rafael/.cache/kflate-benchmark-levels/performance/runs/2026-09-08-kflate-levels/jvm
Running :kflate:linuxX64BenchmarkBenchmark; log: /home/rafael/.cache/kflate-benchmark-levels/performance/runs/2026-09-08-kflate-levels/linuxX64/benchmark.log
Saved 140 measurements to /home/rafael/.cache/kflate-benchmark-levels/performance/runs/2026-09-08-kflate-levels/linuxX64
Running :kflate:wasmJsBenchmarkBenchmark; log: /home/rafael/.cache/kflate-benchmark-levels/performance/runs/2026-09-08-kflate-levels/wasmJs/benchmark.log
Saved 140 measurements to /home/rafael/.cache/kflate-benchmark-levels/performance/runs/2026-09-08-kflate-levels/wasmJs
Loading