Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump ic-repl #96

Merged
merged 40 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ae827b9
test CI
chenyan-dfinity Oct 6, 2023
9b7e452
pin rustc
chenyan-dfinity Oct 6, 2023
6550da9
a failed rustc bump
chenyan-dfinity Oct 7, 2023
23f218b
use new ic-repl
chenyan-dfinity Oct 7, 2023
3c35ea2
fix
chenyan-dfinity Oct 8, 2023
b09a02e
just remove btree example
chenyan-dfinity Oct 8, 2023
d1fed82
small size
chenyan-dfinity Oct 8, 2023
61d3e53
no instrumentation
chenyan-dfinity Oct 8, 2023
ce05eb2
add back profiling, but don't call the __functions
chenyan-dfinity Oct 8, 2023
f87417b
only omit upgrade flamegraph
chenyan-dfinity Oct 8, 2023
e93cbc6
remove remove's flamegraph
chenyan-dfinity Oct 8, 2023
ecaba57
bump ic-wasm
chenyan-dfinity Oct 8, 2023
e005afb
bump again
chenyan-dfinity Oct 8, 2023
8ffb249
restore back
chenyan-dfinity Oct 8, 2023
ab0d3de
bump ic-repl and pin to 1.72.1
chenyan-dfinity Oct 8, 2023
c728e33
append version info
chenyan-dfinity Oct 8, 2023
62985ea
bump rustc
chenyan-dfinity Oct 8, 2023
a137cbb
try streaming profiling
chenyan-dfinity Oct 9, 2023
93e4e19
bump to 8M of log space
chenyan-dfinity Oct 9, 2023
50e5b4d
fix
chenyan-dfinity Oct 9, 2023
33eca59
bump
chenyan-dfinity Oct 9, 2023
66d0fdc
bump default space to 256M
chenyan-dfinity Oct 9, 2023
7d9a181
reduce to 128M
chenyan-dfinity Oct 10, 2023
95983f9
reduce to 64M
chenyan-dfinity Oct 10, 2023
f5402ba
remove rbtree
chenyan-dfinity Oct 10, 2023
5f1238a
small size
chenyan-dfinity Oct 10, 2023
94be7cd
small size
chenyan-dfinity Oct 10, 2023
a19e0f1
free space
chenyan-dfinity Oct 10, 2023
5f6d414
16M
chenyan-dfinity Oct 10, 2023
2817570
report du
chenyan-dfinity Oct 10, 2023
438e919
fix
chenyan-dfinity Oct 10, 2023
d441306
df
chenyan-dfinity Oct 10, 2023
914ab74
12.5M
chenyan-dfinity Oct 10, 2023
5f2ab67
switch to mac runner and back to 64M
chenyan-dfinity Oct 10, 2023
d64ae7f
back to 256M
chenyan-dfinity Oct 10, 2023
1905ef7
restore size
chenyan-dfinity Oct 10, 2023
5bbf3bb
limit collection pages
chenyan-dfinity Oct 11, 2023
d8c2dc7
fix
chenyan-dfinity Oct 11, 2023
4095747
bump
chenyan-dfinity Oct 11, 2023
b7d7887
reduce gc
chenyan-dfinity Oct 11, 2023
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
13 changes: 7 additions & 6 deletions .github/workflows/perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ jobs:
strategy:
fail-fast: false
env:
DFX_VERSION: 0.15.0
DFX_VERSION: 0.15.1
IC_REPL_VERSION: 0.5.0
MOC_VERSION: 0.10.0
IC_WASM_VERSION: 0.5.1
RUSTC_VERSION: 1.72.1
steps:
- uses: actions/checkout@v3
- name: Checkout out gh-pages report
Expand All @@ -32,7 +33,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
toolchain: ${{ env.RUSTC_VERSION }}
override: true
target: wasm32-unknown-unknown
- name: Cache cargo build
Expand All @@ -58,9 +59,7 @@ jobs:
- name: Install ic-repl, mops, dfx, and moc
run: |
echo y | DFX_VERSION=$DFX_VERSION bash -ci "$(curl -fsSL https://smartcontracts.org/install.sh)"
wget https://github.com/chenyan2002/ic-repl/releases/download/$IC_REPL_VERSION/ic-repl-linux64
cp ./ic-repl-linux64 /usr/local/bin/ic-repl
chmod a+x /usr/local/bin/ic-repl
cargo install --git https://github.com/dfinity/ic-repl.git --branch new-meter
npm i -g ic-mops
dfx cache install
cd $(dfx cache show)
Expand All @@ -82,7 +81,9 @@ jobs:
dfx stop
dfx start --clean --background
- name: Run perf
run: make
run: |
make
make emit_version
- name: Generate table
if: github.event_name == 'pull_request'
env:
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@ APPS = dapps collections crypto pub-sub heartbeat motoko

all:
$(foreach test_dir,$(APPS),make -C $(test_dir) &&) true

emit_version:
for f in _out/*/README.md; do \
echo "\n> ## Environment" >> $$f; \
(printf "> * "; dfx --version) >> $$f; \
(printf "> * "; $$(dfx cache show)/moc --version) >> $$f; \
(printf "> * "; rustc --version) >> $$f; \
(printf "> * "; ic-repl --version) >> $$f; \
(printf "> * "; ic-wasm --version) >> $$f; \
done
44 changes: 23 additions & 21 deletions collections/perf.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
#!ic-repl
load "../prelude.sh";

let hashmap = wasm_profiling("motoko/.dfx/local/canisters/hashmap/hashmap.wasm", record { start_page = 16 });
let triemap = wasm_profiling("motoko/.dfx/local/canisters/triemap/triemap.wasm", record { start_page = 16 });
let rbtree = wasm_profiling("motoko/.dfx/local/canisters/rbtree/rbtree.wasm", record { start_page = 16 });
let splay = wasm_profiling("motoko/.dfx/local/canisters/splay/splay.wasm", record { start_page = 16 });
let btree = wasm_profiling("motoko/.dfx/local/canisters/btreemap/btreemap.wasm", record { start_page = 16 });
let zhenya = wasm_profiling("motoko/.dfx/local/canisters/zhenya_hashmap/zhenya_hashmap.wasm", record { start_page = 16 });
let heap = wasm_profiling("motoko/.dfx/local/canisters/heap/heap.wasm", record { start_page = 16 });
let buffer = wasm_profiling("motoko/.dfx/local/canisters/buffer/buffer.wasm", record { start_page = 16 });
let vector = wasm_profiling("motoko/.dfx/local/canisters/vector/vector.wasm", record { start_page = 16 });

let hashmap_rs = wasm_profiling("rust/.dfx/local/canisters/hashmap/hashmap.wasm", record { start_page = 1 });
let btreemap_rs = wasm_profiling("rust/.dfx/local/canisters/btreemap/btreemap.wasm", record { start_page = 1 });
let btreemap_stable_rs = wasm_profiling("rust/.dfx/local/canisters/btreemap_stable/btreemap_stable.wasm", record { start_page = 1 });
let heap_rs = wasm_profiling("rust/.dfx/local/canisters/heap/heap.wasm", record { start_page = 1 });
let heap_stable_rs = wasm_profiling("rust/.dfx/local/canisters/heap_stable/heap_stable.wasm", record { start_page = 1 });
let imrc_hashmap_rs = wasm_profiling("rust/.dfx/local/canisters/imrc_hashmap/imrc_hashmap.wasm", record { start_page = 1 });
let vector_rs = wasm_profiling("rust/.dfx/local/canisters/vector/vector.wasm", record { start_page = 1 });
let vector_stable_rs = wasm_profiling("rust/.dfx/local/canisters/vector_stable/vector_stable.wasm", record { start_page = 1 });
let mo_config = record { start_page = 16; page_limit = 1024 };
let hashmap = wasm_profiling("motoko/.dfx/local/canisters/hashmap/hashmap.wasm", mo_config);
let triemap = wasm_profiling("motoko/.dfx/local/canisters/triemap/triemap.wasm", mo_config);
let rbtree = wasm_profiling("motoko/.dfx/local/canisters/rbtree/rbtree.wasm", mo_config);
let splay = wasm_profiling("motoko/.dfx/local/canisters/splay/splay.wasm", mo_config);
let btree = wasm_profiling("motoko/.dfx/local/canisters/btreemap/btreemap.wasm", mo_config);
let zhenya = wasm_profiling("motoko/.dfx/local/canisters/zhenya_hashmap/zhenya_hashmap.wasm", mo_config);
let heap = wasm_profiling("motoko/.dfx/local/canisters/heap/heap.wasm", mo_config);
let buffer = wasm_profiling("motoko/.dfx/local/canisters/buffer/buffer.wasm", mo_config);
let vector = wasm_profiling("motoko/.dfx/local/canisters/vector/vector.wasm", mo_config);

let rs_config = record { start_page = 1; page_limit = 1024 };
let hashmap_rs = wasm_profiling("rust/.dfx/local/canisters/hashmap/hashmap.wasm", rs_config);
let btreemap_rs = wasm_profiling("rust/.dfx/local/canisters/btreemap/btreemap.wasm", rs_config);
let btreemap_stable_rs = wasm_profiling("rust/.dfx/local/canisters/btreemap_stable/btreemap_stable.wasm", rs_config);
let heap_rs = wasm_profiling("rust/.dfx/local/canisters/heap/heap.wasm", rs_config);
let heap_stable_rs = wasm_profiling("rust/.dfx/local/canisters/heap_stable/heap_stable.wasm", rs_config);
let imrc_hashmap_rs = wasm_profiling("rust/.dfx/local/canisters/imrc_hashmap/imrc_hashmap.wasm", rs_config);
let vector_rs = wasm_profiling("rust/.dfx/local/canisters/vector/vector.wasm", rs_config);
let vector_stable_rs = wasm_profiling("rust/.dfx/local/canisters/vector_stable/vector_stable.wasm", rs_config);

//let movm_rs = wasm_profiling("rust/.dfx/local/canisters/movm/movm.wasm");
//let movm_dynamic_rs = wasm_profiling("rust/.dfx/local/canisters/movm_dynamic/movm_dynamic.wasm");
Expand Down Expand Up @@ -60,9 +62,9 @@ function perf(wasm, title, init, batch) {
uninstall(cid);
};

let init_size = 1_000_000;
let init_size = 500_000;
let batch_size = 50;
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 500k|max mem|batch_get 50|batch_put 50|batch_remove 50|upgrade|\n|--:|--:|--:|--:|--:|--:|--:|--:|\n");
perf(hashmap, "hashmap", init_size, batch_size);
perf(triemap, "triemap", init_size, batch_size);
perf(rbtree, "rbtree", init_size, batch_size);
Expand All @@ -73,7 +75,7 @@ perf(btreemap_rs, "btreemap_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 500k|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
10 changes: 5 additions & 5 deletions motoko/gc.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!ic-repl
load "../prelude.sh";

let default = wasm_profiling("motoko/default.wasm", record { trace_only_funcs = vec{"schedule_copying_gc"} });
let copying = wasm_profiling("motoko/copying.wasm", record { trace_only_funcs = vec {"copying_gc"} });
let compacting = wasm_profiling("motoko/compacting.wasm", record { trace_only_funcs = vec{"compacting_gc"} });
let generational = wasm_profiling("motoko/generational.wasm", record { trace_only_funcs = vec{"generational_gc"} });
let incremental = wasm_profiling("motoko/incremental.wasm", record { trace_only_funcs = vec{"incremental_gc"} });
let default = wasm_profiling("motoko/default.wasm", record { trace_only_funcs = vec{"schedule_copying_gc"}; start_page = 16; page_limit = 1024 });
let copying = wasm_profiling("motoko/copying.wasm", record { trace_only_funcs = vec {"copying_gc"}; start_page = 16; page_limit = 1024 });
let compacting = wasm_profiling("motoko/compacting.wasm", record { trace_only_funcs = vec{"compacting_gc"}; start_page = 16; page_limit = 1024 });
let generational = wasm_profiling("motoko/generational.wasm", record { trace_only_funcs = vec{"generational_gc"}; start_page = 16; page_limit = 1024 });
let incremental = wasm_profiling("motoko/incremental.wasm", record { trace_only_funcs = vec{"incremental_gc"}; start_page = 16; page_limit = 1024 });

let file = "README.md";
output(file, "\n\n## Garbage Collection\n\n| |generate 700k|max mem|batch_get 50|batch_put 50|batch_remove 50|\n|--:|--:|--:|--:|--:|--:|\n");
Expand Down
2 changes: 1 addition & 1 deletion utils/motoko/Profiling.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Region "mo:base/Region";
module {
public func init() : Region.Region {
let profiling = Region.new();
ignore Region.grow(profiling, 32);
ignore Region.grow(profiling, 1024);
profiling;
};
}
2 changes: 1 addition & 1 deletion utils/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn get_upgrade_memory() -> Memory {

pub fn profiling_init() {
let memory = MEMORY_MANAGER.with(|m| m.borrow().get(PROFILING));
memory.grow(32);
memory.grow(1024);
}

pub fn save_stable<T: CandidType>(val: &T) {
Expand Down
Loading