Giter Club home page Giter Club logo

canister-profiling's People

Contributors

byronbecker avatar chenyan-dfinity avatar chenyan2002 avatar ggreif avatar kentosugama avatar matthewhammer avatar rvanasa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

canister-profiling's Issues

Specify mops as a prerequisite/dependency

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.

Motoko Build Errors

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:

  • dfx 0.15.1
  • ic-wasm 0.6.0
  • ic-repl 0.5.1
  • npm 9.7.1
  • mops CLI 0.28.1
  • mops API 1.2
  • rustc 1.73.0 (cc66ad468 2023-10-03)
  • MOC_VERSION 0.10.0
    image

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.

Rust canister release profile tuning

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)
  • Changing 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)
  • Changing opt-level = 3 to opt-level = 2 reduces binary size by 5%+ with negligible cycle cost change (#62)

Rust canister release profile tuning

Instructions for adding other CDKs to the benchmarks

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.