Skip to content

Commit f56a3e9

Browse files
authored
refactor: rename 'compare' benchmark to 'io_chunks' for clarity (#368)
Renames the `compare` benchmark folder to `io_chunks` to better describe what the benchmark actually does. Why the rename: - `compare` was too generic and didn't indicate what was being compared - `io_chunks` clearly describes the benchmark's focus on I/O operations with varying chunk sizes This PR temporarily removes `io_chunks` from CI benchmark job, because current `main` branch does not have it at makes the job fail. It will be re-enabled in the follow-up PR.
1 parent bbd0d0d commit f56a3e9

File tree

5 files changed

+23
-5
lines changed

5 files changed

+23
-5
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,20 @@ jobs:
9494
name:
9595
- btreemap
9696
- btreeset
97+
# - io_chunks TODO: re-enable after new folder is merged.
9798
- memory-manager
9899
- vec
99-
- compare
100100
include:
101101
- name: btreemap
102102
project_dir: ./benchmarks/btreemap
103103
- name: btreeset
104104
project_dir: ./benchmarks/btreeset
105+
# - name: io_chunks
106+
# project_dir: ./benchmarks/io_chunks
105107
- name: memory-manager
106108
project_dir: ./benchmarks/memory_manager
107109
- name: vec
108110
project_dir: ./benchmarks/vec
109-
- name: compare
110-
project_dir: ./benchmarks/compare
111111

112112
env:
113113
PROJECT_DIR: ${{ matrix.project_dir }}

benchmarks/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ name = "vec"
3131
path = "vec/src/main.rs"
3232

3333
[[bin]]
34-
name = "compare"
35-
path = "compare/src/main.rs"
34+
name = "io_chunks"
35+
path = "io_chunks/src/main.rs"
3636

3737
[[bin]]
3838
name = "btreeset"
File renamed without changes.

benchmarks/compare/src/main.rs renamed to benchmarks/io_chunks/src/main.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
//! # I/O Chunks Benchmark
2+
//!
3+
//! Measures read/write performance across different stable storage approaches
4+
//! when handling 100 MiB of data split into varying chunk sizes.
5+
//!
6+
//! Tests approaches:
7+
//! - **Stable Memory**: Direct memory operations (baseline)
8+
//! - **BTreeMap**: Key-value storage with chunk index as key
9+
//! - **StableVec**: Sequential storage pushing chunks
10+
//!
11+
//! Each approach is tested with:
12+
//! - 1 chunk (100 MiB)
13+
//! - 1K chunks (~100 KiB each)
14+
//! - 1M chunks (~100 B each)
15+
//!
16+
//! **Goal**: Evaluate how chunk size affects performance and compare
17+
//! the overhead of stable structures versus raw memory operations.
18+
119
use benchmarks::vec::BoundedVecN;
220
use canbench_rs::{bench, bench_fn, BenchResult};
321
use ic_cdk::api::stable::WASM_PAGE_SIZE_IN_BYTES;

0 commit comments

Comments
 (0)