dfinity / canister-profiling Goto Github PK
View Code? Open in Web Editor NEWCollection of canister performance benchmarks
License: Apache License 2.0
Collection of canister performance benchmarks
License: Apache License 2.0
I tried following the steps in how to reproduce performance report and got the following error:
canister-profiling/heartbeat $ make -e MOC_VERSION=0.10.0
set -e; cd motoko; envsubst < mops.template.toml > mops.toml; mops install; dfx canister create --all; dfx ledger fabricate-cycles --t 100 --canister $(dfx identity get-wallet); dfx build; rm mops.toml; echo "Optimize with ic-wasm"; for f in .dfx/local/canisters//*/*.wasm; do ic-wasm -o $f $f shrink --optimize O3 --keep-name-section; done; cd ..
/bin/sh: 1: mops: not found
make: *** [Makefile:7: motoko] Error 127
It seems I need to install mops before I can proceed.
npm i -g ic-mops
It would be good to document this, or maybe even create a package.json with this as a dependency so you can just npm install
and have install mops locally. I generally prefer to install dependencies without the -g
flag, even for CLI tools.
I'm having trouble getting the Motoko benchmarks to run locally, likely because there are additional setup steps necessary to get motoko to build.
I have followed the steps in Reproduce Performance Report. I've installed the prerequisites, copied the networks.json into ~/.config/dfx, set the MOC_VERSION
to 0.10.0, and run make
.
Specifically, when on the main branch if I run dfx start --clean
in one terminal, and then in another one cd into /dapps
and run make
(with the MOC_VERSION set) I get the following error:
set -e; cd motoko; envsubst < mops.template.toml > mops.toml; mops install; dfx canister create --all; dfx ledger fabricate-cycles --t 100 --canister $(dfx identity get-wallet); dfx build; rm mops.toml; echo "Optimize with ic-wasm"; for f in .dfx/local/canisters//*/*.wasm; do ic-wasm -o $f $f optimize O3 --keep-name-section; done; cd ..
(node:559214) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
All packages installed
Creating a wallet canister on the local network.
The wallet canister on the "local" network for user "default" is "bnz7o-iuaaa-aaaaa-qaaaa-cai"
Creating canister basic_dao...
basic_dao canister created with canister id: bkyz2-fmaaa-aaaaa-qaaaq-cai
Creating canister dip721_nft...
dip721_nft canister created with canister id: bd3sg-teaaa-aaaaa-qaaba-cai
Fabricating 100000000000000 cycles onto bnz7o-iuaaa-aaaaa-qaaaa-cai
Fabricated 100000000000000 cycles, updated balance: 193_800_000_000_000 cycles
Building canisters...
Error: Failed while trying to build all canisters.
Caused by: Failed while trying to build all canisters.
The build step failed for canister 'bd3sg-teaaa-aaaaa-qaaba-cai' (dip721_nft) with an embedded error: Failed to build Motoko canister 'dip721_nft'.: Failed to compile Motoko.: Failed to run 'moc'.: The command '"/home/dan/.cache/dfinity/versions/0.15.1/moc" "/home/dan/repos/demergent-labs/canister-profiling/dapps/motoko/dip721-nft/Main.mo" "-o" "/home/dan/repos/demergent-labs/canister-profiling/dapps/motoko/.dfx/local/canisters/dip721_nft/dip721_nft.wasm" "-c" "--debug" "--idl" "--stable-types" "--public-metadata" "candid:service" "--public-metadata" "candid:args" "--actor-idl" "/home/dan/repos/demergent-labs/canister-profiling/dapps/motoko/.dfx/local/canisters/idl/" "--actor-alias" "basic_dao" "bkyz2-fmaaa-aaaaa-qaaaq-cai" "--actor-alias" "dip721_nft" "bd3sg-teaaa-aaaaa-qaaba-cai" "--package" "base" ".mops/_github/[email protected]/src"' failed with exit status 'exit status: 1'.
Stdout:
Stderr:
.mops/_github/[email protected]/src/Region.mo:44.35-44.41: type error [M0030], type field Region does not exist in type
module {
type Any = Any;
type Blob = Blob;
type Bool = Bool;
type Char = Char;
type Error = Error;
type Float = Float;
type Int = Int;
type Int16 = Int16;
type Int32 = Int32;
type Int64 = Int64;
type Int8 = Int8;
type Nat = Nat;
type Nat16 = Nat16;
type Nat32 = Nat32;
type Nat64 = Nat64;
type Nat8 = Nat8;
type None = None;
type Null = Null;
type Principal = Principal;
type Text = Text
}
make: *** [Makefile:7: motoko] Error 255
This is happening for more than just the dapps example though.
Here are the versions of my installed prerequisites:
I imagine there's a simple step around motoko develpment that I'm just missing. I just don't do motoko dev so I'm not familiar with it's setup process.
With the current rustc
setup, the best Rust release profile for canister seems to be:
[profile.release]
lto = true
opt-level = 2
Observations:
LTO = true
reduces both binary size and cycle cost (#63)LTO = true
to LTO = 'thin'
increases both binary size and cycle cost (#64, #65)opt-level = 'z'
reduces binary size by 20%+ with cycle cost also increased by 20%+ (#61)opt-level = 3
to opt-level = 2
reduces binary size by 5%+ with negligible cycle cost change (#62)How would one use this to generate regular profiling information for canisters running on the mainnet and written in Rust? Is this at all possible?
Hi,
Before digging in, I'm just wondering if you could make some instructions for how to add other CDKs to these benchmarks. I can probably figure it out, but would be nice to know exactly which directories need to be created and which sh scripts, makefiles, etc need to be changed.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.