Skip to content

Commit

Permalink
adjust to 800k
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyan-dfinity committed Sep 30, 2023
1 parent 4d75426 commit 16789ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions collections/perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let vector_rs = wasm_profiling("rust/.dfx/local/canisters/vector/vector.wasm", r
//let movm_dynamic_rs = wasm_profiling("rust/.dfx/local/canisters/movm_dynamic/movm_dynamic.wasm");

let file = "README.md";
output(file, "\n## Map\n\n| |binary_size|generate 1m|max mem|batch_get 50|batch_put 50|batch_remove 50|upgrade|\n|--:|--:|--:|--:|--:|--:|--:|--:|\n");
output(file, "\n## Map\n\n| |binary_size|generate 800k|max mem|batch_get 50|batch_put 50|batch_remove 50|upgrade|\n|--:|--:|--:|--:|--:|--:|--:|--:|\n");

function perf(wasm, title, init, batch) {
let cid = install(wasm, encode (), null);
Expand Down Expand Up @@ -59,7 +59,7 @@ function perf(wasm, title, init, batch) {
uninstall(cid);
};

let init_size = 1_000_000;
let init_size = 800_000;
let batch_size = 50;

perf(hashmap, "hashmap", init_size, batch_size);
Expand All @@ -73,7 +73,7 @@ perf(btreemap_stable_rs, "btreemap_stable_rs", init_size, batch_size);
perf(imrc_hashmap_rs, "imrc_hashmap_rs", init_size, batch_size);
perf(hashmap_rs, "hashmap_rs", init_size, batch_size);

output(file, "\n## Priority queue\n\n| |binary_size|heapify 1m|max mem|pop_min 50|put 50|pop_min 50|upgrade|\n|--:|--:|--:|--:|--:|--:|--:|--:|\n");
output(file, "\n## Priority queue\n\n| |binary_size|heapify 800k|max mem|pop_min 50|put 50|pop_min 50|upgrade|\n|--:|--:|--:|--:|--:|--:|--:|--:|\n");
perf(heap, "heap", init_size, batch_size);
perf(heap_rs, "heap_rs", init_size, batch_size);

Expand Down
4 changes: 3 additions & 1 deletion collections/rust/src/btreemap_stable/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ fn generate(size: u32) {

#[ic_cdk::query]
fn get_mem() -> (u128, u128, u128) {
utils::get_mem()
let memory = ic_cdk::api::stable::CanisterStableMemory::Default();
let size = memory.stable_size() as u128;
(size, size, size)
}

#[ic_cdk::update]
Expand Down

0 comments on commit 16789ef

Please sign in to comment.