bzip2
2 changed files+15−6
benchcompress/src/benchcompress/algorithms/__init__.pymodified+3−1View file
@@ -1,3 +1,4 @@
1+from .bzip2 import algorithms as bzip2_algorithms
12 from .zlib import algorithms as zlib_algorithms
23 from .zstd import algorithms as zstd_algorithms
34 from .ans import algorithms as ans_algorithms
@@ -5,7 +6,8 @@ from .lzma import algorithms as lzma_algorithms
56 from .brotli import algorithms as brotli_algorithms
67
78 algorithms = (
8- zlib_algorithms
9+ bzip2_algorithms
10+ + zlib_algorithms
911 + zstd_algorithms
1012 + ans_algorithms
1113 + lzma_algorithms
benchcompress/src/benchcompress/run_benchmarks.pymodified+12−5View file
@@ -97,6 +97,9 @@ def run_benchmarks(
9797 dataset_tags = dataset.get("tags", [])
9898 print(f"\n*** Dataset: {dataset['name']} (tags: {dataset_tags}) ***")
9999
100+ # only create the dataset if it is needed
101+ data = None
102+
100103 for algorithm in algorithms_to_run:
101104 alg_name = algorithm["name"]
102105 alg_tags = algorithm.get("tags", [])
@@ -168,11 +171,15 @@ def run_benchmarks(
168171 results.append(result)
169172 continue
170173
171- print(" Running new benchmark...")
172- data = dataset["create"]()
174+ print(f" Running benchmark for {alg_name} on {dataset['name']}...")
175+ if data is None:
176+ data = dataset["create"]()
177+ print(f"Created dataset: shape={data.shape}, dtype={data.dtype}")
178+ else:
179+ print("Dataset already created")
173180 dtype = str(data.dtype)
174181 original_size = len(data.tobytes())
175- print(f"Created dataset: shape={data.shape}, dtype={dtype}")
182+ print(f"Dataset: shape={data.shape}, dtype={dtype}")
176183 print(f"Original size: {original_size:,} bytes")
177184
178185 # Upload dataset to memobin if enabled
@@ -264,7 +271,7 @@ def run_benchmarks(
264271 mb_per_sec = array_size_mb / median_time
265272 return median_time, mb_per_sec, ret
266273
267- # Measure encoding with multiple trials
274+ print(" Encoding...")
268275 encode_time, encode_mb_per_sec, encoded = run_timed_trials(
269276 algorithm["encode"], data
270277 )
@@ -276,7 +283,7 @@ def run_benchmarks(
276283 print(f" Encode time: {encode_time*1000:.2f}ms")
277284 print(f" Encode throughput: {encode_mb_per_sec:.2f} MB/s")
278285
279- print(" Verifying decompression...")
286+ print(" Decoding...")
280287 # Measure decoding with multiple trials
281288 decode_time, decode_mb_per_sec, decoded = run_timed_trials(
282289 algorithm["decode"], encoded, dtype, data.shape