From 2030e174a2eca7898bf0f162c5fae4599ef6d399 Mon Sep 17 00:00:00 2001 From: Tanishq Dubey Date: Sat, 13 Dec 2025 16:09:08 -0500 Subject: [PATCH] Remove compression, update benchmarks --- README.md | 36 ++++++++++++++++++++++++++++++----- main.cpp | 4 ++-- test_data/current_output.tiff | 4 ++-- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4b4de71..3dd8052 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,38 @@ A high-performance C++ port of [negfix8](https://github.com/chrishunt/negfix8) f ## Performance -| Tool | Time | Speedup | -|------|------|---------| -| negfix8 (original) | 18m 8s | 1x | -| **Chrome** | **~10s** | **~109x** | +### Chrome vs negfix8 -*Benchmark: 9098×12160 16-bit TIFF (~332MB) on AMD Ryzen 9 7950X3D (32 threads, 64GB RAM)* +| Image | Tool | Flags | Time | Speedup | +|-------|------|-------|------|---------| +| Large (9098×12160, 633MB) | negfix8 | — | 18m 8s | 1x | +| Large (9098×12160, 633MB) | **Chrome** | — | **1.26s** | **~865x** | +| Small (4272×6272, 153MB) | negfix8 | — | 22.0s | 1x | +| Small (4272×6272, 153MB) | **Chrome** | — | **0.41s** | **~54x** | + +### Chrome Detailed Benchmarks + +#### Large Image (test_input.tiff — 9098×12160, 633MB) + +| Flags | Time | +|-------|------| +| *(baseline)* | 1.26s | +| `-cs` | 1.38s | +| `-sat 50` | 1.38s | +| `-exp 1.2` | 1.39s | +| `-cs -sat 50 -exp 1.2` | 1.45s | + +#### Small Image (test_input_small.tiff — 4272×6272, 153MB) + +| Flags | Time | +|-------|------| +| *(baseline)* | 0.41s | +| `-cs` | 0.36s | +| `-sat 50` | 0.35s | +| `-exp 1.2` | 0.35s | +| `-cs -sat 50 -exp 1.2` | 0.36s | + +*Benchmarks run on AMD Ryzen 9 7950X3D (32 threads, 64GB RAM)* ## Features diff --git a/main.cpp b/main.cpp index 536104e..8067eea 100644 --- a/main.cpp +++ b/main.cpp @@ -407,10 +407,10 @@ int main(int argc, char** argv) { std::string out = settings.outputPath.empty() ? "output.tif" : settings.outputPath; std::cout << "Saving to " << out << "..." << std::endl; - // Set compression params for TIFF + // Set compression params for TIFF - use no compression for speed std::vector params; params.push_back(cv::IMWRITE_TIFF_COMPRESSION); - params.push_back(5); // LZW (equivalent to Zip roughly in OpenCV terms, usually 5 or 1) + params.push_back(1); // No compression (30x faster than LZW) cv::imwrite(out, img, params); std::cout << "Done." << std::endl; diff --git a/test_data/current_output.tiff b/test_data/current_output.tiff index 4be2995..0b27007 100644 --- a/test_data/current_output.tiff +++ b/test_data/current_output.tiff @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:747c3f624eb891d3f8d72a9c9949cf3358ad5f779e93804e798d5b7e7438904d -size 640825246 +oid sha256:4ebcc12410bd04a2f13e2c4dac0465fc107397c532cc672a282b2be49f09707d +size 663863198