{"id":13523902,"url":"https://github.com/dfinity/canister-profiling","last_synced_at":"2025-10-03T17:06:00.588Z","repository":{"id":65833830,"uuid":"533539851","full_name":"dfinity/canister-profiling","owner":"dfinity","description":"Collection of canister performance benchmarks","archived":false,"fork":false,"pushed_at":"2025-03-19T14:50:59.000Z","size":77074,"stargazers_count":20,"open_issues_count":19,"forks_count":8,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-04-01T01:36:27.605Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dfinity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-06T23:59:46.000Z","updated_at":"2025-03-18T21:49:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"ab44f131-ce19-4555-b30d-41a3bafb0d26","html_url":"https://github.com/dfinity/canister-profiling","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dfinity/canister-profiling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Fcanister-profiling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Fcanister-profiling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Fcanister-profiling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Fcanister-profiling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfinity","download_url":"https://codeload.github.com/dfinity/canister-profiling/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Fcanister-profiling/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273317765,"owners_count":25084037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:01:04.956Z","updated_at":"2025-10-03T17:05:55.555Z","avatar_url":"https://github.com/dfinity.png","language":"Rust","readme":"# canister-profiling\n\nThis repository contains code and scripts for collecting performance data for different canisters running on the IC.\n\nCommunity contributions are strongly encouraged.\n\n## Performance report\n\nPerformance reports are generated in `gh-pages` branch. The reported Wasm binary size is after the instrumentation.\n\n* [Sample dapps](http://dfinity.github.io/canister-profiling/dapps)\n* [Collection libraries](http://dfinity.github.io/canister-profiling/collections)\n* [Cryptographic libraries](http://dfinity.github.io/canister-profiling/crypto)\n* [Publisher \u0026 Subscriber](http://dfinity.github.io/canister-profiling/pub-sub)\n* [Heartbeat / Timer](http://dfinity.github.io/canister-profiling/heartbeat)\n* [Motoko specific benchmarks](http://dfinity.github.io/canister-profiling/motoko)\n\n## How to reproduce performance report\n\n### Prerequisites:\n\n- [Install Internet Computer SDK](https://sdk.dfinity.org/docs/quickstart/local-quickstart.html)\n- [Install ic-wasm](https://github.com/dfinity/ic-wasm/releases)\n- [Install ic-repl](https://github.com/dfinity/ic-repl/releases)\n- [Install npm](https://nodejs.org/en/download/)\n- [Install mops](https://mops.one/docs/install)\n  ```\n  npm i -g ic-mops\n  ```\n- [Install Rust](https://www.rust-lang.org/tools/install)\n- Add wasm32 target to Rust\n  ```\n  rustup target add wasm32-unknown-unknown\n  ```\n\n### Running locally:\n\n* Make sure that local replica is configured as system subnet. If not, run `cp networks.json ~/.config/dfx/`\n* `dfx start --clean`\n* Run `make -e MOC_VERSION=\u003cMOC_VERSION\u003e`\n* The results are stored in `_out/`\n\n## How to create a new benchmark\n\nEach benchmark usually contains multiple implementations written in different languages, e.g., Motoko and Rust.\nThe folder follows the following structure:\n\n```\nBenchmark_name/\n  Makefile\n  README.md // Perf result will be appended to this markdown file.\n  perf.sh   // ic-repl script that generates perf result. If the candid interface is different, we can use multiple scripts.\n  motoko/\n    dfx.json\n    src/\n      benchmark1.mo\n      benchmark2.mo\n  rust/\n    dfx.json\n    benchmark1/\n      Cargo.toml\n      benchmark1.did\n      src/\n        lib.rs\n    benchmark2/\n      Cargo.toml\n      benchmark2.did\n      src/\n        lib.rs\n```\n\n## Wasm Optimizer\n\nA Wasm optimizer is applied to each Wasm binary before instrumentation. The optimizer can be found in [ic-wasm](https://github.com/dfinity/ic-wasm), which wraps [wasm-opt](https://github.com/WebAssembly/binaryen).\n\nThe following optimizations are applied:\n```\nic-wasm -o \u003cwasm\u003e \u003cwasm\u003e shrink --optimize O3 --keep-name-section\n```\n\nNote that the name section is preserved in the optimization process. This is because the name section is used by the profiler to produce the flame graphs.\n\nFor users who wish to use the optimizer, the easiest way is to enable it via a field in `dfx.json`:\n\n```\n{\n  \"canisters\": {\n    \"my_canister\": {\n      \"optimize\": \"cycles\"\n    }\n  }\n}\n```\nThis, as in most real world uses, removes the name section to minimize the binary size.\n","funding_links":[],"categories":["Developer Tooling"],"sub_categories":["Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfinity%2Fcanister-profiling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfinity%2Fcanister-profiling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfinity%2Fcanister-profiling/lists"}