Skip to content

Commit 8d9e0a8

Browse files
bump ic-repl (dfinity#96)
* Bump ic-repl/ic-wasm to fix the heap out of bound bug in `__get_profiling` * bump profiling trace to 256M (8M for collection) * Append version info at the end of the report
1 parent c9d17d6 commit 8d9e0a8

File tree

12 files changed

+106
-91
lines changed

12 files changed

+106
-91
lines changed

.github/workflows/perf.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ on:
77

88
jobs:
99
perf:
10-
runs-on: ubuntu-latest
10+
runs-on: macos-latest
1111
strategy:
1212
fail-fast: false
1313
env:
14-
DFX_VERSION: 0.15.0
15-
IC_REPL_VERSION: 0.5.0
14+
DFX_VERSION: 0.15.1
15+
IC_REPL_VERSION: 0.5.1
1616
MOC_VERSION: 0.10.0
17-
IC_WASM_VERSION: 0.5.1
17+
IC_WASM_VERSION: 0.6.0
18+
RUSTC_VERSION: 1.73.0
1819
steps:
1920
- uses: actions/checkout@v3
2021
- name: Checkout out gh-pages report
@@ -32,7 +33,7 @@ jobs:
3233
- uses: actions-rs/toolchain@v1
3334
with:
3435
profile: minimal
35-
toolchain: stable
36+
toolchain: ${{ env.RUSTC_VERSION }}
3637
override: true
3738
target: wasm32-unknown-unknown
3839
- name: Cache cargo build
@@ -58,16 +59,16 @@ jobs:
5859
- name: Install ic-repl, mops, dfx, and moc
5960
run: |
6061
echo y | DFX_VERSION=$DFX_VERSION bash -ci "$(curl -fsSL https://smartcontracts.org/install.sh)"
61-
wget https://github.com/chenyan2002/ic-repl/releases/download/$IC_REPL_VERSION/ic-repl-linux64
62-
cp ./ic-repl-linux64 /usr/local/bin/ic-repl
62+
wget https://github.com/chenyan2002/ic-repl/releases/download/$IC_REPL_VERSION/ic-repl-macos
63+
cp ./ic-repl-macos /usr/local/bin/ic-repl
6364
chmod a+x /usr/local/bin/ic-repl
6465
npm i -g ic-mops
6566
dfx cache install
6667
cd $(dfx cache show)
67-
wget https://github.com/dfinity/motoko/releases/download/$MOC_VERSION/motoko-Linux-x86_64-$MOC_VERSION.tar.gz
68-
tar zxvf motoko-Linux-x86_64-$MOC_VERSION.tar.gz
69-
wget https://github.com/dfinity/ic-wasm/releases/download/$IC_WASM_VERSION/ic-wasm-linux64
70-
cp ./ic-wasm-linux64 /usr/local/bin/ic-wasm
68+
wget https://github.com/dfinity/motoko/releases/download/$MOC_VERSION/motoko-Darwin-x86_64-$MOC_VERSION.tar.gz
69+
tar zxvf motoko-Darwin-x86_64-$MOC_VERSION.tar.gz
70+
wget https://github.com/dfinity/ic-wasm/releases/download/$IC_WASM_VERSION/ic-wasm-macos
71+
cp ./ic-wasm-macos /usr/local/bin/ic-wasm
7172
chmod a+x /usr/local/bin/ic-wasm
7273
- name: Setup system subnet and start dfx
7374
run: |
@@ -82,7 +83,9 @@ jobs:
8283
dfx stop
8384
dfx start --clean --background
8485
- name: Run perf
85-
run: make
86+
run: |
87+
make
88+
make emit_version
8689
- name: Generate table
8790
if: github.event_name == 'pull_request'
8891
env:

Cargo.lock

Lines changed: 40 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,13 @@ APPS = dapps collections crypto pub-sub heartbeat motoko
22

33
all:
44
$(foreach test_dir,$(APPS),make -C $(test_dir) &&) true
5+
6+
emit_version:
7+
for f in _out/*/README.md; do \
8+
echo "\n> ## Environment" >> $$f; \
9+
(printf "> * "; dfx --version) >> $$f; \
10+
(printf "> * "; $$(dfx cache show)/moc --version) >> $$f; \
11+
(printf "> * "; rustc --version) >> $$f; \
12+
(printf "> * "; ic-repl --version) >> $$f; \
13+
(printf "> * "; ic-wasm --version) >> $$f; \
14+
done

collections/perf.sh

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
#!ic-repl
22
load "../prelude.sh";
33

4-
let hashmap = wasm_profiling("motoko/.dfx/local/canisters/hashmap/hashmap.wasm", record { start_page = 16 });
5-
let triemap = wasm_profiling("motoko/.dfx/local/canisters/triemap/triemap.wasm", record { start_page = 16 });
6-
let rbtree = wasm_profiling("motoko/.dfx/local/canisters/rbtree/rbtree.wasm", record { start_page = 16 });
7-
let splay = wasm_profiling("motoko/.dfx/local/canisters/splay/splay.wasm", record { start_page = 16 });
8-
let btree = wasm_profiling("motoko/.dfx/local/canisters/btreemap/btreemap.wasm", record { start_page = 16 });
9-
let zhenya = wasm_profiling("motoko/.dfx/local/canisters/zhenya_hashmap/zhenya_hashmap.wasm", record { start_page = 16 });
10-
let heap = wasm_profiling("motoko/.dfx/local/canisters/heap/heap.wasm", record { start_page = 16 });
11-
let buffer = wasm_profiling("motoko/.dfx/local/canisters/buffer/buffer.wasm", record { start_page = 16 });
12-
let vector = wasm_profiling("motoko/.dfx/local/canisters/vector/vector.wasm", record { start_page = 16 });
13-
14-
let hashmap_rs = wasm_profiling("rust/.dfx/local/canisters/hashmap/hashmap.wasm", record { start_page = 1 });
15-
let btreemap_rs = wasm_profiling("rust/.dfx/local/canisters/btreemap/btreemap.wasm", record { start_page = 1 });
16-
let btreemap_stable_rs = wasm_profiling("rust/.dfx/local/canisters/btreemap_stable/btreemap_stable.wasm", record { start_page = 1 });
17-
let heap_rs = wasm_profiling("rust/.dfx/local/canisters/heap/heap.wasm", record { start_page = 1 });
18-
let heap_stable_rs = wasm_profiling("rust/.dfx/local/canisters/heap_stable/heap_stable.wasm", record { start_page = 1 });
19-
let imrc_hashmap_rs = wasm_profiling("rust/.dfx/local/canisters/imrc_hashmap/imrc_hashmap.wasm", record { start_page = 1 });
20-
let vector_rs = wasm_profiling("rust/.dfx/local/canisters/vector/vector.wasm", record { start_page = 1 });
21-
let vector_stable_rs = wasm_profiling("rust/.dfx/local/canisters/vector_stable/vector_stable.wasm", record { start_page = 1 });
4+
// use smaller page_limit to speed things up, since the whole trace is too large even with 256M.
5+
let mo_config = record { start_page = 16; page_limit = 128 };
6+
let hashmap = wasm_profiling("motoko/.dfx/local/canisters/hashmap/hashmap.wasm", mo_config);
7+
let triemap = wasm_profiling("motoko/.dfx/local/canisters/triemap/triemap.wasm", mo_config);
8+
let rbtree = wasm_profiling("motoko/.dfx/local/canisters/rbtree/rbtree.wasm", mo_config);
9+
let splay = wasm_profiling("motoko/.dfx/local/canisters/splay/splay.wasm", mo_config);
10+
let btree = wasm_profiling("motoko/.dfx/local/canisters/btreemap/btreemap.wasm", mo_config);
11+
let zhenya = wasm_profiling("motoko/.dfx/local/canisters/zhenya_hashmap/zhenya_hashmap.wasm", mo_config);
12+
let heap = wasm_profiling("motoko/.dfx/local/canisters/heap/heap.wasm", mo_config);
13+
let buffer = wasm_profiling("motoko/.dfx/local/canisters/buffer/buffer.wasm", mo_config);
14+
let vector = wasm_profiling("motoko/.dfx/local/canisters/vector/vector.wasm", mo_config);
15+
16+
let rs_config = record { start_page = 1; page_limit = 128 };
17+
let hashmap_rs = wasm_profiling("rust/.dfx/local/canisters/hashmap/hashmap.wasm", rs_config);
18+
let btreemap_rs = wasm_profiling("rust/.dfx/local/canisters/btreemap/btreemap.wasm", rs_config);
19+
let btreemap_stable_rs = wasm_profiling("rust/.dfx/local/canisters/btreemap_stable/btreemap_stable.wasm", rs_config);
20+
let heap_rs = wasm_profiling("rust/.dfx/local/canisters/heap/heap.wasm", rs_config);
21+
let heap_stable_rs = wasm_profiling("rust/.dfx/local/canisters/heap_stable/heap_stable.wasm", rs_config);
22+
let imrc_hashmap_rs = wasm_profiling("rust/.dfx/local/canisters/imrc_hashmap/imrc_hashmap.wasm", rs_config);
23+
let vector_rs = wasm_profiling("rust/.dfx/local/canisters/vector/vector.wasm", rs_config);
24+
let vector_stable_rs = wasm_profiling("rust/.dfx/local/canisters/vector_stable/vector_stable.wasm", rs_config);
2225

2326
//let movm_rs = wasm_profiling("rust/.dfx/local/canisters/movm/movm.wasm");
2427
//let movm_dynamic_rs = wasm_profiling("rust/.dfx/local/canisters/movm_dynamic/movm_dynamic.wasm");

crypto/perf.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ load "../prelude.sh";
33

44
let sha_mo = wasm_profiling("motoko/.dfx/local/canisters/sha/sha.wasm");
55
let sha_rs = wasm_profiling("rust/.dfx/local/canisters/sha/sha.wasm");
6-
let map_mo = wasm_profiling("motoko/.dfx/local/canisters/certified_map/certified_map.wasm", record { start_page = 16 });
7-
let map_rs = wasm_profiling("rust/.dfx/local/canisters/certified_map/certified_map.wasm", record { start_page = 1 });
6+
let map_mo = wasm_profiling("motoko/.dfx/local/canisters/certified_map/certified_map.wasm", mo_config);
7+
let map_rs = wasm_profiling("rust/.dfx/local/canisters/certified_map/certified_map.wasm", rs_config);
88
let sample = file("sample_wasm.bin");
99

1010
let file = "README.md";

dapps/basic_dao.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ identity cathy;
88
identity dory;
99
identity genesis;
1010

11-
let motoko = wasm_profiling("motoko/.dfx/local/canisters/basic_dao/basic_dao.wasm", record { start_page = 16 });
12-
let rust = wasm_profiling("rust/.dfx/local/canisters/basic_dao/basic_dao.wasm", record { start_page = 1 });
11+
let motoko = wasm_profiling("motoko/.dfx/local/canisters/basic_dao/basic_dao.wasm", mo_config);
12+
let rust = wasm_profiling("rust/.dfx/local/canisters/basic_dao/basic_dao.wasm", rs_config);
1313

1414
let file = "README.md";
1515
output(file, "\n## Basic DAO\n\n| |binary_size|init|transfer_token|submit_proposal|vote_proposal|upgrade|\n|--|--:|--:|--:|--:|--:|--:|\n");

0 commit comments

Comments
 (0)