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

A more optimized stable B-Tree #95

Draft
wants to merge 14 commits into
base: claudio/sardariussBTree
Choose a base branch
from
Draft
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
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 @@ -3,3 +3,13 @@ APPS = collections

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
2 changes: 1 addition & 1 deletion collections/motoko/mops.template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ stableheapbtreemap = "1.3.0"
map = "9.0.0"
splay = "0.1.0"
vector = "0.2.0"
StableBTree = "https://github.com/crusso/MotokoStableBTree"
StableBTree = "https://github.com/crusso/MotokoStableBTree#claudio"
41 changes: 22 additions & 19 deletions collections/perf.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
#!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 btree_stable = wasm_profiling("motoko/.dfx/local/canisters/btreemap_stable/btreemap_stable.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 btree_stable = wasm_profiling("motoko/.dfx/local/canisters/btreemap_stable/btreemap_stable.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
Loading
Loading