Skip to content

Commit

Permalink
bump ic-repl (dfinity#96)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
chenyan-dfinity authored Oct 11, 2023
1 parent c9d17d6 commit 8d9e0a8
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 91 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ on:

jobs:
perf:
runs-on: ubuntu-latest
runs-on: macos-latest
strategy:
fail-fast: false
env:
DFX_VERSION: 0.15.0
IC_REPL_VERSION: 0.5.0
DFX_VERSION: 0.15.1
IC_REPL_VERSION: 0.5.1
MOC_VERSION: 0.10.0
IC_WASM_VERSION: 0.5.1
IC_WASM_VERSION: 0.6.0
RUSTC_VERSION: 1.73.0
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,16 +59,16 @@ 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
wget https://github.com/chenyan2002/ic-repl/releases/download/$IC_REPL_VERSION/ic-repl-macos
cp ./ic-repl-macos /usr/local/bin/ic-repl
chmod a+x /usr/local/bin/ic-repl
npm i -g ic-mops
dfx cache install
cd $(dfx cache show)
wget https://github.com/dfinity/motoko/releases/download/$MOC_VERSION/motoko-Linux-x86_64-$MOC_VERSION.tar.gz
tar zxvf motoko-Linux-x86_64-$MOC_VERSION.tar.gz
wget https://github.com/dfinity/ic-wasm/releases/download/$IC_WASM_VERSION/ic-wasm-linux64
cp ./ic-wasm-linux64 /usr/local/bin/ic-wasm
wget https://github.com/dfinity/motoko/releases/download/$MOC_VERSION/motoko-Darwin-x86_64-$MOC_VERSION.tar.gz
tar zxvf motoko-Darwin-x86_64-$MOC_VERSION.tar.gz
wget https://github.com/dfinity/ic-wasm/releases/download/$IC_WASM_VERSION/ic-wasm-macos
cp ./ic-wasm-macos /usr/local/bin/ic-wasm
chmod a+x /usr/local/bin/ic-wasm
- name: Setup system subnet and start dfx
run: |
Expand All @@ -82,7 +83,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
86 changes: 40 additions & 46 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
39 changes: 21 additions & 18 deletions collections/perf.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
#!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 });
// use smaller page_limit to speed things up, since the whole trace is too large even with 256M.
let mo_config = record { start_page = 16; page_limit = 128 };
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 = 128 };
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
4 changes: 2 additions & 2 deletions crypto/perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ load "../prelude.sh";

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

let file = "README.md";
Expand Down
4 changes: 2 additions & 2 deletions dapps/basic_dao.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ identity cathy;
identity dory;
identity genesis;

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

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

0 comments on commit 8d9e0a8

Please sign in to comment.