Canister cycle consumption calculation

To estimate the cycle consumption you need to know approximately how many Wasm instructions are executed by the update call.

Conversion of the number of executed Wasm instructions to cycles is done in withdraw_execution_cycles of CyclesAccountManager: ic/lib.rs at master · dfinity/ic · GitHub

Note that some system APIs are counted as multiple instructions depending on their overhead: Heads-Up: Fixing PROD issue by adjusting the complexity of some System API calls

3 Likes