Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
335 changes: 184 additions & 151 deletions Cargo.lock

Large diffs are not rendered by default.

26 changes: 17 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ repository = "https://github.com/dfinity/stable-structures"
version = "0.6.8"

[dependencies]
ic_principal = { version = "0.1.1", default-features = false }
canbench-rs = { workspace = true, optional = true } # Optional to benchmark parts of the code.
canbench-rs = { workspace = true, optional = true } # Optional to benchmark parts of the code.
ic_principal = { workspace = true, default-features = false }

[dev-dependencies]
candid.workspace = true
hex = "0.4.3"
ic-cdk.workspace = true
hex.workspace = true
ic-cdk-macros.workspace = true
maplit = "1.0.2"
proptest = "1"
tempfile = "3.3.0"
test-strategy = "0.3.1"
ic-cdk.workspace = true
maplit.workspace = true
proptest.workspace = true
tempfile.workspace = true
test-strategy.workspace = true

[features]
bench_scope = ["dep:canbench-rs"] # May add significant overhead.
Expand All @@ -33,6 +33,14 @@ members = ["benchmarks"]

[workspace.dependencies]
canbench-rs = "0.1.15"
candid = "0.10.3"
candid = "0.10.14"
hex = "0.4.3"
ic_principal = "0.1.1"
ic-cdk = "0.12.1"
ic-cdk-macros = "0.8.4"
maplit = "1.0.2"
proptest = "1"
serde = "1.0.132"
tempfile = "3.3.0"
test-strategy = "0.3.1"
tiny-rng = "0.2.0"
8 changes: 4 additions & 4 deletions benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ edition = "2021"
[dependencies]
canbench-rs.workspace = true
candid.workspace = true
ic-cdk.workspace = true
ic-cdk-macros.workspace = true
ic-cdk.workspace = true
ic-stable-structures = { path = "../", features = [] }
maplit = "1.0.2"
serde = "1.0"
tiny-rng = "0.2.0"
maplit.workspace = true
serde.workspace = true
tiny-rng.workspace = true

[lib]
path = "src/lib.rs"
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/btreemap/canbench.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
build_cmd: cargo build -p benchmarks --release --target wasm32-unknown-unknown
build_cmd: cargo build -p benchmarks --release --target wasm32-unknown-unknown --locked

wasm_path: ../../target/wasm32-unknown-unknown/release/btreemap.wasm
2 changes: 1 addition & 1 deletion benchmarks/compare/canbench.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
build_cmd: cargo build -p benchmarks --release --target wasm32-unknown-unknown
build_cmd: cargo build -p benchmarks --release --target wasm32-unknown-unknown --locked

wasm_path: ../../target/wasm32-unknown-unknown/release/compare.wasm
24 changes: 12 additions & 12 deletions benchmarks/compare/canbench_results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ benches:
read_chunks_btreemap_1:
total:
calls: 1
instructions: 1219162653
instructions: 1219162597
heap_increase: 3233
stable_memory_increase: 1665
scopes: {}
read_chunks_btreemap_1k:
total:
calls: 1
instructions: 5414908732
instructions: 5414908676
heap_increase: 1604
stable_memory_increase: 1665
scopes: {}
read_chunks_btreemap_1m:
total:
calls: 1
instructions: 133588820142
instructions: 133588820086
heap_increase: 1892
stable_memory_increase: 3201
scopes: {}
Expand Down Expand Up @@ -44,42 +44,42 @@ benches:
read_chunks_vec_1:
total:
calls: 1
instructions: 1363286555
instructions: 1363286620
heap_increase: 3202
stable_memory_increase: 1665
scopes: {}
read_chunks_vec_1k:
total:
calls: 1
instructions: 1378501974
instructions: 1378475066
heap_increase: 3200
stable_memory_increase: 1665
scopes: {}
read_chunks_vec_1m:
total:
calls: 1
instructions: 4748969057
instructions: 4721969149
heap_increase: 3784
stable_memory_increase: 1665
scopes: {}
write_chunks_btreemap_1:
total:
calls: 1
instructions: 1069803070
instructions: 1069803049
heap_increase: 3233
stable_memory_increase: 1665
scopes: {}
write_chunks_btreemap_1k:
total:
calls: 1
instructions: 4914919710
instructions: 4914919689
heap_increase: 1604
stable_memory_increase: 1665
scopes: {}
write_chunks_btreemap_1m:
total:
calls: 1
instructions: 89822427812
instructions: 89822427791
heap_increase: 1892
stable_memory_increase: 3201
scopes: {}
Expand Down Expand Up @@ -107,21 +107,21 @@ benches:
write_chunks_vec_1:
total:
calls: 1
instructions: 1257790996
instructions: 1257791061
heap_increase: 3202
stable_memory_increase: 1665
scopes: {}
write_chunks_vec_1k:
total:
calls: 1
instructions: 1272039677
instructions: 1272012769
heap_increase: 3200
stable_memory_increase: 1665
scopes: {}
write_chunks_vec_1m:
total:
calls: 1
instructions: 3739427314
instructions: 3712427406
heap_increase: 3784
stable_memory_increase: 1665
scopes: {}
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/memory_manager/canbench.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
build_cmd: cargo build -p benchmarks --release --target wasm32-unknown-unknown
build_cmd: cargo build -p benchmarks --release --target wasm32-unknown-unknown --locked

wasm_path: ../../target/wasm32-unknown-unknown/release/memory_manager.wasm
2 changes: 1 addition & 1 deletion benchmarks/vec/canbench.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
build_cmd: cargo build -p benchmarks --release --target wasm32-unknown-unknown
build_cmd: cargo build -p benchmarks --release --target wasm32-unknown-unknown --locked

wasm_path: ../../target/wasm32-unknown-unknown/release/vec.wasm
Loading