Run experiments to measure heartbeat cost on the IC.
- Experiments run on canisters written in Rust and Motoko
- Empty canisters
*_empty
, time is measured outside ofdfx
call - Non-empty canisters with measurements done inside the canister
- Empty canisters
- Results are based on ~15 minutes of measurements
Experiment | Hearbeat Rate | Burn Rate per Sec | Burn Rate per Year |
---|---|---|---|
rust |
917 ms | ~0.65 MC | ~21 TC |
motoko |
917 ms | ~2.24 MC | ~71 TC |
Note: non-production dfx
runs a single node which causes reduced heartbeat rate and elevated costs.
Experiment | Hearbeat Rate | Burn Rate per Sec | Burn Rate per Year | Code | Data |
---|---|---|---|---|---|
rust |
703 ms | ~0.86 MC | ~27 TC | code | data |
rust_empty |
- | ~0.86 MC | ~27 TC | code | data |
motoko |
706 ms | ~2.94 MC | ~93 TC | code | data |
motoko_empty |
- | ~3.01 MC | ~95 TC | code | data |
# Enter either motoko or rust folder.
$ cd motoko
# or
$ cd rust
# Start DFX and deploy a canister.
$ dfx start --background
$ dfx deploy
# Open Candid UI
# - call "reset" function to start measurements
# - call "report" function to get statistics since the last reset
# Stop/delete canisters, stop DFX execution.
$ dfx canister stop --all
$ dfx canister delete --all
$ dfx stop
# Enter either motoko_empty or rust_empty folder.
$ cd motoko_empty
# or
$ cd rust_empty
# Start DFX and deploy a canister.
$ dfx start --background
$ dfx deploy
# Run experiment.
$ ./run_experiment.py
# Stop/delete canisters, stop DFX execution.
$ dfx canister stop --all
$ dfx canister delete --all
$ dfx stop