/ concept-collection / benchcompress
Sign in
concept-collection / benchcompress
pages
Jeremy Magland <jmagland@flatironinstitute.org> committed commit 85d34494618c parent 8d8d5fa Browse files
12 changed files+348−48
web-ui/package-lock.jsonmodified+63−1View file
@@ -14,7 +14,8 @@
1414 "plotly.js-dist-min": "^2.35.3",
1515 "react": "^18.3.1",
1616 "react-dom": "^18.3.1",
17- "react-plotly.js": "^2.6.0"
17+ "react-plotly.js": "^2.6.0",
18+ "react-router-dom": "^7.1.3"
1819 },
1920 "devDependencies": {
2021 "@eslint/js": "^9.17.0",
@@ -1578,6 +1579,11 @@
15781579 "@babel/types": "^7.20.7"
15791580 }
15801581 },
1582+ "node_modules/@types/cookie": {
1583+ "version": "0.6.0",
1584+ "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz",
1585+ "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA=="
1586+ },
15811587 "node_modules/@types/eslint": {
15821588 "version": "9.6.1",
15831589 "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz",
@@ -2601,6 +2607,14 @@
26012607 "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
26022608 "dev": true
26032609 },
2610+ "node_modules/cookie": {
2611+ "version": "1.0.2",
2612+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz",
2613+ "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==",
2614+ "engines": {
2615+ "node": ">=18"
2616+ }
2617+ },
26042618 "node_modules/core-util-is": {
26052619 "version": "1.0.3",
26062620 "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
@@ -5369,6 +5383,44 @@
53695383 "node": ">=0.10.0"
53705384 }
53715385 },
5386+ "node_modules/react-router": {
5387+ "version": "7.1.3",
5388+ "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.1.3.tgz",
5389+ "integrity": "sha512-EezYymLY6Guk/zLQ2vRA8WvdUhWFEj5fcE3RfWihhxXBW7+cd1LsIiA3lmx+KCmneAGQuyBv820o44L2+TtkSA==",
5390+ "dependencies": {
5391+ "@types/cookie": "^0.6.0",
5392+ "cookie": "^1.0.1",
5393+ "set-cookie-parser": "^2.6.0",
5394+ "turbo-stream": "2.4.0"
5395+ },
5396+ "engines": {
5397+ "node": ">=20.0.0"
5398+ },
5399+ "peerDependencies": {
5400+ "react": ">=18",
5401+ "react-dom": ">=18"
5402+ },
5403+ "peerDependenciesMeta": {
5404+ "react-dom": {
5405+ "optional": true
5406+ }
5407+ }
5408+ },
5409+ "node_modules/react-router-dom": {
5410+ "version": "7.1.3",
5411+ "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.1.3.tgz",
5412+ "integrity": "sha512-qQGTE+77hleBzv9SIUIkGRvuFBQGagW+TQKy53UTZAO/3+YFNBYvRsNIZ1GT17yHbc63FylMOdS+m3oUriF1GA==",
5413+ "dependencies": {
5414+ "react-router": "7.1.3"
5415+ },
5416+ "engines": {
5417+ "node": ">=20.0.0"
5418+ },
5419+ "peerDependencies": {
5420+ "react": ">=18",
5421+ "react-dom": ">=18"
5422+ }
5423+ },
53725424 "node_modules/readable-stream": {
53735425 "version": "2.3.8",
53745426 "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
@@ -5682,6 +5734,11 @@
56825734 "randombytes": "^2.1.0"
56835735 }
56845736 },
5737+ "node_modules/set-cookie-parser": {
5738+ "version": "2.7.1",
5739+ "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz",
5740+ "integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ=="
5741+ },
56855742 "node_modules/shallow-copy": {
56865743 "version": "0.0.1",
56875744 "resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz",
@@ -6134,6 +6191,11 @@
61346191 "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
61356192 "peer": true
61366193 },
6194+ "node_modules/turbo-stream": {
6195+ "version": "2.4.0",
6196+ "resolved": "https://registry.npmjs.org/turbo-stream/-/turbo-stream-2.4.0.tgz",
6197+ "integrity": "sha512-FHncC10WpBd2eOmGwpmQsWLDoK4cqsA/UT/GqNoaKOQnT8uzhtCbg3EoUDMvqpOSAI0S26mr0rkjzbOO6S3v1g=="
6198+ },
61376199 "node_modules/type": {
61386200 "version": "2.7.3",
61396201 "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz",
web-ui/package.jsonmodified+2−1View file
@@ -17,7 +17,8 @@
1717 "plotly.js-dist-min": "^2.35.3",
1818 "react": "^18.3.1",
1919 "react-dom": "^18.3.1",
20- "react-plotly.js": "^2.6.0"
20+ "react-plotly.js": "^2.6.0",
21+ "react-router-dom": "^7.1.3"
2122 },
2223 "devDependencies": {
2324 "@eslint/js": "^9.17.0",
web-ui/src/App.tsxmodified+61−39View file
@@ -1,45 +1,67 @@
1-import { BenchmarkTable } from "./components/BenchmarkTable";
1+import { BrowserRouter, Routes, Route, Link } from "react-router-dom";
2+import Home from "./pages/Home";
3+import Datasets from "./pages/Datasets";
4+import Algorithms from "./pages/Algorithms";
25
36 function App() {
47 return (
5- <div style={{ padding: "2rem" }}>
6- <header style={{ marginBottom: "2rem" }}>
7- <h1
8- style={{
9- fontSize: "2rem",
10- fontWeight: "bold",
11- color: "#333",
12- }}
13- >
14- ZIA Integer Compression Benchmark
15- </h1>
16- <p
17- style={{
18- color: "#666",
19- marginTop: "0.5rem",
20- }}
21- >
22- Comparing different integer array compression algorithms and their
23- performance
24- </p>
25- <a
26- href="https://github.com/magland/zia"
27- target="_blank"
28- rel="noopener noreferrer"
29- style={{
30- color: "#0066cc",
31- textDecoration: "none",
32- display: "inline-block",
33- marginTop: "0.5rem",
34- }}
35- >
36- View source on GitHub
37- </a>
38- </header>
39- <main>
40- <BenchmarkTable />
41- </main>
42- </div>
8+ <BrowserRouter>
9+ <div style={{ padding: "2rem" }}>
10+ <nav style={{ marginBottom: "2rem" }}>
11+ <ul style={{
12+ listStyle: "none",
13+ padding: 0,
14+ margin: 0,
15+ display: "flex",
16+ gap: "1.5rem"
17+ }}>
18+ <li>
19+ <Link
20+ to="/"
21+ style={{
22+ color: "#0066cc",
23+ textDecoration: "none",
24+ fontWeight: "500"
25+ }}
26+ >
27+ Home
28+ </Link>
29+ </li>
30+ <li>
31+ <Link
32+ to="/datasets"
33+ style={{
34+ color: "#0066cc",
35+ textDecoration: "none",
36+ fontWeight: "500"
37+ }}
38+ >
39+ Datasets
40+ </Link>
41+ </li>
42+ <li>
43+ <Link
44+ to="/algorithms"
45+ style={{
46+ color: "#0066cc",
47+ textDecoration: "none",
48+ fontWeight: "500"
49+ }}
50+ >
51+ Algorithms
52+ </Link>
53+ </li>
54+ </ul>
55+ </nav>
56+ <main>
57+ <Routes>
58+ <Route path="/" element={<Home />} />
59+ <Route path="/datasets" element={<Datasets />} />
60+ <Route path="/algorithms" element={<Algorithms />} />
61+ </Routes>
62+ </main>
63+ </div>
64+ </BrowserRouter>
4365 );
4466 }
4567
web-ui/src/pages/Algorithms.tsxadded+62−0View file
@@ -0,0 +1,62 @@
1+function Algorithms() {
2+ return (
3+ <div>
4+ <h1
5+ style={{
6+ fontSize: "2rem",
7+ fontWeight: "bold",
8+ color: "#333",
9+ marginBottom: "1rem",
10+ }}
11+ >
12+ Compression Algorithms
13+ </h1>
14+ <div className="algorithms">
15+ <section style={{ marginBottom: "2rem" }}>
16+ <h2 style={{ fontSize: "1.5rem", color: "#444", marginBottom: "1rem" }}>
17+ Zlib
18+ </h2>
19+ <p style={{ color: "#666", marginBottom: "1rem" }}>
20+ [Algorithm description will be loaded from results.json]
21+ </p>
22+ <div style={{ color: "#666", marginLeft: "1rem" }}>
23+ <div>• zlib-1 (fastest)</div>
24+ <div>• zlib-3</div>
25+ <div>• zlib-5</div>
26+ <div>• zlib-7</div>
27+ <div>• zlib-9 (best compression)</div>
28+ </div>
29+ </section>
30+
31+ <section style={{ marginBottom: "2rem" }}>
32+ <h2 style={{ fontSize: "1.5rem", color: "#444", marginBottom: "1rem" }}>
33+ Zstandard (zstd)
34+ </h2>
35+ <p style={{ color: "#666", marginBottom: "1rem" }}>
36+ [Algorithm description will be loaded from results.json]
37+ </p>
38+ <div style={{ color: "#666", marginLeft: "1rem" }}>
39+ <div>• zstd-4 (faster)</div>
40+ <div>• zstd-7</div>
41+ <div>• zstd-10</div>
42+ <div>• zstd-13</div>
43+ <div>• zstd-16</div>
44+ <div>• zstd-19</div>
45+ <div>• zstd-22 (better compression)</div>
46+ </div>
47+ </section>
48+
49+ <section style={{ marginBottom: "2rem" }}>
50+ <h2 style={{ fontSize: "1.5rem", color: "#444", marginBottom: "1rem" }}>
51+ Simple ANS
52+ </h2>
53+ <p style={{ color: "#666", marginBottom: "1rem" }}>
54+ [Algorithm description will be loaded from results.json]
55+ </p>
56+ </section>
57+ </div>
58+ </div>
59+ );
60+}
61+
62+export default Algorithms;
web-ui/src/pages/Datasets.tsxadded+51−0View file
@@ -0,0 +1,51 @@
1+function Datasets() {
2+ return (
3+ <div>
4+ <h1
5+ style={{
6+ fontSize: "2rem",
7+ fontWeight: "bold",
8+ color: "#333",
9+ marginBottom: "1rem",
10+ }}
11+ >
12+ Benchmark Datasets
13+ </h1>
14+ <div className="dataset-types">
15+ <section style={{ marginBottom: "2rem" }}>
16+ <h2 style={{ fontSize: "1.5rem", color: "#444", marginBottom: "1rem" }}>
17+ Bernoulli Datasets
18+ </h2>
19+ <p style={{ color: "#666", marginBottom: "1rem" }}>
20+ [Dataset description will be loaded from results.json]
21+ </p>
22+ <div style={{ color: "#666", marginLeft: "1rem" }}>
23+ <div>• bernoulli-0.1</div>
24+ <div>• bernoulli-0.2</div>
25+ <div>• bernoulli-0.3</div>
26+ <div>• bernoulli-0.4</div>
27+ <div>• bernoulli-0.5</div>
28+ </div>
29+ </section>
30+
31+ <section style={{ marginBottom: "2rem" }}>
32+ <h2 style={{ fontSize: "1.5rem", color: "#444", marginBottom: "1rem" }}>
33+ Gaussian Datasets
34+ </h2>
35+ <p style={{ color: "#666", marginBottom: "1rem" }}>
36+ [Dataset description will be loaded from results.json]
37+ </p>
38+ <div style={{ color: "#666", marginLeft: "1rem" }}>
39+ <div>• gaussian-1</div>
40+ <div>• gaussian-2</div>
41+ <div>• gaussian-3</div>
42+ <div>• gaussian-5</div>
43+ <div>• gaussian-8</div>
44+ </div>
45+ </section>
46+ </div>
47+ </div>
48+ );
49+}
50+
51+export default Datasets;
web-ui/src/pages/Home.tsxadded+46−0View file
@@ -0,0 +1,46 @@
1+import { BenchmarkTable } from "../components/BenchmarkTable";
2+
3+function Home() {
4+ return (
5+ <div>
6+ <header style={{ marginBottom: "2rem" }}>
7+ <h1
8+ style={{
9+ fontSize: "2rem",
10+ fontWeight: "bold",
11+ color: "#333",
12+ }}
13+ >
14+ Integer Compression Benchmark
15+ </h1>
16+ <p
17+ style={{
18+ color: "#666",
19+ marginTop: "0.5rem",
20+ }}
21+ >
22+ Comparing different integer array compression algorithms and their
23+ performance
24+ </p>
25+ <a
26+ href="https://github.com/magland/zia"
27+ target="_blank"
28+ rel="noopener noreferrer"
29+ style={{
30+ color: "#0066cc",
31+ textDecoration: "none",
32+ display: "inline-block",
33+ marginTop: "0.5rem",
34+ }}
35+ >
36+ View source on GitHub
37+ </a>
38+ </header>
39+ <main>
40+ <BenchmarkTable />
41+ </main>
42+ </div>
43+ );
44+}
45+
46+export default Home;
web-ui/src/types.tsmodified+16−0View file
@@ -16,6 +16,22 @@ export interface BenchmarkResult {
1616 timestamp: number;
1717 }
1818
19+export interface Algorithm {
20+ name: string;
21+ description: string;
22+ version: string;
23+ tags: string[];
24+}
25+
26+export interface Dataset {
27+ name: string;
28+ description: string;
29+ version: string;
30+ tags: string[];
31+}
32+
1933 export interface BenchmarkData {
2034 results: BenchmarkResult[];
35+ algorithms: Algorithm[];
36+ datasets: Dataset[];
2137 }
zia_benchmark/src/zia_benchmark/algorithms/zlib/__init__.pymodified+6−0View file
@@ -43,6 +43,7 @@ algorithms = [
4343 "version": "1",
4444 "encode": lambda x: zlib_encode(x, level=1),
4545 "decode": lambda x, dtype: zlib_decode(x, dtype),
46+ "description": "Zlib DEFLATE compression at level 1 (fastest).",
4647 "tags": [],
4748 },
4849 {
@@ -50,6 +51,7 @@ algorithms = [
5051 "version": "1",
5152 "encode": lambda x: zlib_encode(x, level=3),
5253 "decode": lambda x, dtype: zlib_decode(x, dtype),
54+ "description": "Zlib DEFLATE compression at level 3.",
5355 "tags": [],
5456 },
5557 {
@@ -57,6 +59,7 @@ algorithms = [
5759 "version": "1",
5860 "encode": lambda x: zlib_encode(x, level=5),
5961 "decode": lambda x, dtype: zlib_decode(x, dtype),
62+ "description": "Zlib DEFLATE compression at level 5 (medium).",
6063 "tags": [],
6164 },
6265 {
@@ -64,6 +67,7 @@ algorithms = [
6467 "version": "1",
6568 "encode": lambda x: zlib_encode(x, level=7),
6669 "decode": lambda x, dtype: zlib_decode(x, dtype),
70+ "description": "Zlib DEFLATE compression at level 7.",
6771 "tags": [],
6872 },
6973 {
@@ -71,6 +75,7 @@ algorithms = [
7175 "version": "1",
7276 "encode": lambda x: zlib_encode(x, level=9),
7377 "decode": lambda x, dtype: zlib_decode(x, dtype),
78+ "description": "Zlib DEFLATE compression at maximum level 9.",
7479 "tags": [],
7580 },
7681 {
@@ -78,6 +83,7 @@ algorithms = [
7883 "version": "1",
7984 "encode": lambda x: zlib_delta_encode(x, level=9),
8085 "decode": lambda x, dtype: zlib_delta_decode(x, dtype),
86+ "description": "Zlib DEFLATE compression at level 9 with delta encoding.",
8187 "tags": ["delta_encoding"],
8288 },
8389 ]
zia_benchmark/src/zia_benchmark/datasets/bernoulli/__init__.pymodified+5−0View file
@@ -12,30 +12,35 @@ datasets = [
1212 "name": "bernoulli-0.1",
1313 "version": "1",
1414 "create": lambda: create_bernoulli(n_samples=1_000_000, p=0.1, seed=0),
15+ "description": "Binary sequence with 10% probability of ones.",
1516 "tags": ["binary"],
1617 },
1718 {
1819 "name": "bernoulli-0.2",
1920 "version": "1",
2021 "create": lambda: create_bernoulli(n_samples=1_000_000, p=0.2, seed=0),
22+ "description": "Binary sequence with 20% probability of ones.",
2123 "tags": ["binary"],
2224 },
2325 {
2426 "name": "bernoulli-0.3",
2527 "version": "1",
2628 "create": lambda: create_bernoulli(n_samples=1_000_000, p=0.3, seed=0),
29+ "description": "Binary sequence with 30% probability of ones.",
2730 "tags": ["binary"],
2831 },
2932 {
3033 "name": "bernoulli-0.4",
3134 "version": "1",
3235 "create": lambda: create_bernoulli(n_samples=1_000_000, p=0.4, seed=0),
36+ "description": "Binary sequence with 40% probability of ones.",
3337 "tags": ["binary"],
3438 },
3539 {
3640 "name": "bernoulli-0.5",
3741 "version": "1",
3842 "create": lambda: create_bernoulli(n_samples=1_000_000, p=0.5, seed=0),
43+ "description": "Binary sequence with 50% probability of ones and 50% probability of zeros.",
3944 "tags": ["binary"],
4045 },
4146 ]
zia_benchmark/src/zia_benchmark/datasets/gaussian/__init__.pymodified+5−0View file
@@ -12,30 +12,35 @@ datasets = [
1212 "name": "gaussian-1",
1313 "version": "1",
1414 "create": lambda: create_gaussian(n_samples=1_000_000, stddev=1, seed=0),
15+ "description": "Rounded Gaussian integers with σ=1.",
1516 "tags": [],
1617 },
1718 {
1819 "name": "gaussian-2",
1920 "version": "1",
2021 "create": lambda: create_gaussian(n_samples=1_000_000, stddev=2, seed=0),
22+ "description": "Rounded Gaussian integers with σ=2.",
2123 "tags": [],
2224 },
2325 {
2426 "name": "gaussian-3",
2527 "version": "1",
2628 "create": lambda: create_gaussian(n_samples=1_000_000, stddev=3, seed=0),
29+ "description": "Rounded Gaussian integers with σ=3.",
2730 "tags": [],
2831 },
2932 {
3033 "name": "gaussian-5",
3134 "version": "1",
3235 "create": lambda: create_gaussian(n_samples=1_000_000, stddev=5, seed=0),
36+ "description": "Rounded Gaussian integers with σ=5.",
3337 "tags": [],
3438 },
3539 {
3640 "name": "gaussian-8",
3741 "version": "1",
3842 "create": lambda: create_gaussian(n_samples=1_000_000, stddev=8, seed=0),
43+ "description": "Rounded Gaussian integers with σ=8.",
3944 "tags": [],
4045 },
4146 ]
zia_benchmark/src/zia_benchmark/datasets/real/__init__.pymodified+6−6View file
@@ -105,7 +105,7 @@ datasets = [
105105 {
106106 "name": "real-000876-ch45",
107107 "version": "1",
108- "description": "Real neurophysiology data from DANDI:000876, channel 45",
108+ "description": "Raw extracellular electrophysiology recording from DANDI:000876.",
109109 "create": lambda: _load_real_000876(
110110 num_samples=500_000, num_channels=1, start_channel=45
111111 ).flatten(),
@@ -114,7 +114,7 @@ datasets = [
114114 {
115115 "name": "real-000409-ch101",
116116 "version": "1",
117- "description": "Real neurophysiology data from DANDI:000409, channel 101",
117+ "description": "Raw extracellular electrophysiology recording from DANDI:000409.",
118118 "create": lambda: _load_real_000409(
119119 num_samples=500_000, num_channels=1, start_channel=101
120120 ).flatten(),
@@ -123,7 +123,7 @@ datasets = [
123123 {
124124 "name": "real-001290-ch0",
125125 "version": "1",
126- "description": "Real neurophysiology data from DANDI:001290, channel 0",
126+ "description": "Raw extracellular electrophysiology recording from DANDI:001290.",
127127 "create": lambda: _load_real_001290(
128128 num_samples=500_000, num_channels=1, start_channel=0
129129 ).flatten(),
@@ -132,7 +132,7 @@ datasets = [
132132 {
133133 "name": "real-000876-ch45-filtered",
134134 "version": "1",
135- "description": "Filtered version of real-000876-ch45 with bandpass filtering (300-6000 Hz) and quantization",
135+ "description": "Preprocessed version of real-000876-ch45. Bandpass filtered (300-6000 Hz).",
136136 "create": lambda: _create_filtered_version(
137137 _load_real_000876(
138138 num_samples=500_000, num_channels=1, start_channel=45
@@ -143,7 +143,7 @@ datasets = [
143143 {
144144 "name": "real-000409-ch101-filtered",
145145 "version": "1",
146- "description": "Filtered version of real-000409-ch101 with bandpass filtering (300-6000 Hz) and quantization",
146+ "description": "Preprocessed version of real-000409-ch101. Bandpass filtered (300-6000 Hz).",
147147 "create": lambda: _create_filtered_version(
148148 _load_real_000409(
149149 num_samples=500_000, num_channels=1, start_channel=101
@@ -154,7 +154,7 @@ datasets = [
154154 {
155155 "name": "real-001290-ch0-filtered",
156156 "version": "1",
157- "description": "Filtered version of real-001290-ch0 with bandpass filtering (300-6000 Hz) and quantization",
157+ "description": "Preprocessed version of real-001290-ch0. Bandpass filtered (300-6000 Hz).",
158158 "create": lambda: _create_filtered_version(
159159 _load_real_001290(
160160 num_samples=500_000, num_channels=1, start_channel=0
zia_benchmark/src/zia_benchmark/run_benchmarks.pymodified+25−1View file
@@ -243,4 +243,28 @@ def run_benchmarks(
243243 print(f" Warning: Failed to upload to memobin: {str(e)}")
244244
245245 print("\n=== Benchmark Run Complete ===\n")
246- return {"results": results}
246+
247+ # Collect algorithm and dataset information as lists
248+ algorithm_info = []
249+ for algorithm in algorithms:
250+ algorithm_info.append({
251+ "name": algorithm["name"],
252+ "description": algorithm.get("description", ""),
253+ "version": algorithm["version"],
254+ "tags": algorithm.get("tags", [])
255+ })
256+
257+ dataset_info = []
258+ for dataset in datasets:
259+ dataset_info.append({
260+ "name": dataset["name"],
261+ "description": dataset.get("description", ""),
262+ "version": dataset["version"],
263+ "tags": dataset.get("tags", [])
264+ })
265+
266+ return {
267+ "results": results,
268+ "algorithms": algorithm_info,
269+ "datasets": dataset_info
270+ }
moveopenescclose