Conversation
This commit replaces the custom performance testing logic with a formal benchmarking suite and updates the project's visual branding.
- **Benchmarks & Performance**:
- Integrates `kotlinx-benchmark` for JVM, Linux x64, and Wasm/JS targets.
- Introduces `BenchmarkCorpus` to provide deterministic, generated test data, removing the dependency on local resource files.
- Adds `BENCHMARKING.md` to document suite execution, comparable metrics, and result interpretation.
- Removes legacy `performance/` result files and custom `PerformanceComparisonTest` implementations.
- Configures specific benchmark compilations and associated source sets in `kflate/build.gradle.kts`.
- **Visuals & Documentation**:
- Redesigns `KFlate-Logo.svg` with a modern "input flow" visual style.
- Updates `README.md` for version `1.1.0` and points to the new benchmarking documentation.
- **Build & Dependencies**:
- Upgrades Gradle to `9.5.0`, Kotlin to `2.3.21`, and AGP to `9.2.0`.
- Updates `kotlinx-io` to `0.9.0`.
- Removes `kmp-file` and `kotlinx-datetime` dependencies.
- Refines the multiplatform target list, removing several X64 native variants.
This commit simplifies the benchmarking infrastructure by removing multi-format abstractions and focusing on raw compression/decompression performance.
- **`BenchmarkState.kt`**:
- Renames `CorpusBenchmarkState` to `RawBenchmarkState`.
- Removes `PreparedBenchmarkData` and replaces the complex metrics reporting logic with a streamlined `setupRawBenchmark` helper and `rawBenchmarkReportLine` function.
- **Benchmarks**:
- Updates `CompressionBenchmarks` and `KompressBaselineBenchmarks` to inherit from `RawBenchmarkState` and call compression APIs directly instead of through a codec interface.
- **Infrastructure Removal**:
- Deletes `BenchmarkCodecs.kt`, `BenchmarkFormat.kt`, and `BenchmarkMetrics.kt` as the abstraction layers are no longer needed.
- **Dependencies**:
- Updates `kompress` to version `1.4.2` in `gradle/libs.versions.toml`.
- **Docs**:
- **`BENCHMARKING.md`**: Updates instructions to reflect the class rename to `RawBenchmarkState`.
- **`README.md`**: Removes unnecessary imports from the GZIP code snippet.
- **README.md**: Removes redundant import statements from the Raw DEFLATE and ZLIB code examples to improve readability. - **BENCHMARKING.md**: Removes detailed sections regarding running local benchmarks, publishing results, and updating baselines. - **.gitignore**: Updates the ignore list to replace `CLAUDE.md` with `AGENTS.md`.
This commit introduces automated generation of benchmark comparison tables (Markdown and JSON) to compare KFlate performance against baselines across JVM, Native, and Wasm targets.
- **`scripts/benchmark_comparison.py`**:
- New script to parse `kotlinx-benchmark` JSON results and custom metadata.
- Generates formatted Markdown tables and a summary JSON file.
- Handles stale report detection and multi-platform data merging.
- **Gradle Configuration**:
- Updates `benchmarkAll` to automatically trigger the comparison script.
- Adds `prepareBenchmarkAll` to clean up previous results and metadata.
- Adds `benchmarkComparison` task to run the reporting script.
- **Benchmark Infrastructure**:
- **`BenchmarkState.kt`**: Now captures compressed size metadata and platform information.
- Implements `expect`/`actual` `appendBenchmarkMetadata` for JVM, Linux x64, and Wasm/JS to support platform-specific file I/O during benchmarks.
- Standardizes decompression benchmarks to use a canonical input for more accurate cross-library comparison.
- **Documentation**:
- Updates `BENCHMARKING.md` with instructions for running the automated reports and interpreting the new output files.
…recision
This commit streamlines how benchmark metadata is collected and processed while increasing the number of iterations for more stable performance results.
- **`scripts/benchmark_comparison.py`**:
- Simplifies metadata loading by requiring an explicit file path instead of searching through multiple candidate directories.
- Removes internal globbing and discovery logic in favor of a single source of truth.
- **Gradle Configuration**:
- **`kflate/build.gradle.kts`**:
- Increases `warmups` to 8 and `iterations` to 15 to improve measurement stability.
- Introduces `collectBenchmarkMetadata`, a new task that consolidates metadata from JVM, Native, and Wasm build directories into a single JSONL file using `awk` for deduplication.
- Updates `benchmarkComparison` to depend on metadata consolidation and pass the explicit path to the reporting script.
- **Documentation**:
- **`BENCHMARKING.md`**:
- Updates instructions to include the new metadata consolidation step.
- Reflects the updated iteration counts in the technical suite description.
- Clarifies that the comparison script now requires explicit metadata instead of attempting to resolve multiple paths.
* Reject sizes that overflow internal buffers * Clarify oversized input error
* Keep the web demo responsive on worker failures * Release the web worker URL after startup
Remove the one-line error factory and throw FlateError at each call site.
Let compression levels manage hash-table memory
…-their-cost Make DEFLATE levels trade speed for smaller output
Prepare 1.1.0 release and refresh the compression demo
Select benchmark libraries and retain collected measurements
Cut scratch allocation for short compression inputs
Expand inflate matches with bulk copies
Reuse fixed token prices in level 9 parsing
Choose stored blocks using their actual padding cost
remove unused benchmark and design artifacts
cut level-6 match search overhead with rolling hash
Remove benchmarks and simplify demo scrolling
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.
Prepare master for KFlate 1.1.0 with the completed compression, correctness, and browser demo changes.
Validation on the development branch:
This PR does not add Maven Central release automation or publish version 1.1.0.