diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aeb8dc56..120febf0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,20 +94,20 @@ jobs: name: - btreemap - btreeset + # - io_chunks TODO: re-enable after new folder is merged. - memory-manager - vec - - compare include: - name: btreemap project_dir: ./benchmarks/btreemap - name: btreeset project_dir: ./benchmarks/btreeset + # - name: io_chunks + # project_dir: ./benchmarks/io_chunks - name: memory-manager project_dir: ./benchmarks/memory_manager - name: vec project_dir: ./benchmarks/vec - - name: compare - project_dir: ./benchmarks/compare env: PROJECT_DIR: ${{ matrix.project_dir }} diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index 753b1972..cdc9f771 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -31,8 +31,8 @@ name = "vec" path = "vec/src/main.rs" [[bin]] -name = "compare" -path = "compare/src/main.rs" +name = "io_chunks" +path = "io_chunks/src/main.rs" [[bin]] name = "btreeset" diff --git a/benchmarks/compare/canbench.yml b/benchmarks/io_chunks/canbench.yml similarity index 100% rename from benchmarks/compare/canbench.yml rename to benchmarks/io_chunks/canbench.yml diff --git a/benchmarks/compare/canbench_results.yml b/benchmarks/io_chunks/canbench_results.yml similarity index 100% rename from benchmarks/compare/canbench_results.yml rename to benchmarks/io_chunks/canbench_results.yml diff --git a/benchmarks/compare/src/main.rs b/benchmarks/io_chunks/src/main.rs similarity index 87% rename from benchmarks/compare/src/main.rs rename to benchmarks/io_chunks/src/main.rs index 04148e0f..cfe6ba73 100644 --- a/benchmarks/compare/src/main.rs +++ b/benchmarks/io_chunks/src/main.rs @@ -1,3 +1,21 @@ +//! # I/O Chunks Benchmark +//! +//! Measures read/write performance across different stable storage approaches +//! when handling 100 MiB of data split into varying chunk sizes. +//! +//! Tests approaches: +//! - **Stable Memory**: Direct memory operations (baseline) +//! - **BTreeMap**: Key-value storage with chunk index as key +//! - **StableVec**: Sequential storage pushing chunks +//! +//! Each approach is tested with: +//! - 1 chunk (100 MiB) +//! - 1K chunks (~100 KiB each) +//! - 1M chunks (~100 B each) +//! +//! **Goal**: Evaluate how chunk size affects performance and compare +//! the overhead of stable structures versus raw memory operations. + use benchmarks::vec::BoundedVecN; use canbench_rs::{bench, bench_fn, BenchResult}; use ic_cdk::api::stable::WASM_PAGE_SIZE_IN_BYTES;