{"id":24054619,"url":"https://github.com/cardinal-cryptography/contract-benchmarking","last_synced_at":"2026-06-18T14:33:02.300Z","repository":{"id":230262600,"uuid":"775876305","full_name":"Cardinal-Cryptography/contract-benchmarking","owner":"Cardinal-Cryptography","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-28T15:58:11.000Z","size":107,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-11-20T14:33:25.829Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cardinal-Cryptography.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-22T08:14:03.000Z","updated_at":"2025-05-24T09:48:54.000Z","dependencies_parsed_at":"2024-03-28T18:59:56.956Z","dependency_job_id":null,"html_url":"https://github.com/Cardinal-Cryptography/contract-benchmarking","commit_stats":null,"previous_names":["cardinal-cryptography/contract-benchmarking"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Cardinal-Cryptography/contract-benchmarking","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardinal-Cryptography%2Fcontract-benchmarking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardinal-Cryptography%2Fcontract-benchmarking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardinal-Cryptography%2Fcontract-benchmarking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardinal-Cryptography%2Fcontract-benchmarking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cardinal-Cryptography","download_url":"https://codeload.github.com/Cardinal-Cryptography/contract-benchmarking/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardinal-Cryptography%2Fcontract-benchmarking/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34495378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"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":"2025-01-09T03:49:02.721Z","updated_at":"2026-06-18T14:33:02.270Z","avatar_url":"https://github.com/Cardinal-Cryptography.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# contract-benchmarking\n\nComparing riscv and wasm contract performance with drink.\n\n# Reproduction\n\n```bash\nmake pull-image\nmake run-flipper-simulation\nmake run-dex-simulation\n```\n\nOutput should be:\n```\n----------------------------------------\n[flipper][riscv][deploy]: 132,782,316\n[flipper][wasm] [deploy]: 267,840,354\nSpeedup: 50%\n----------------------------------------\n[flipper][riscv][flip]: 255,099,016\n[flipper][wasm] [flip]: 395,707,235\nSpeedup: 64%\n----------------------------------------\n[factory][riscv][set_fee_collector]: 613,937,156\n[factory][wasm] [set_fee_collector]: 764,658,899\nSpeedup: 80%\n----------------------------------------\n[psp22][riscv][increase_allowance]: 1,406,080,363\n[psp22][wasm] [increase_allowance]: 2,133,153,103\nSpeedup: 66%\n----------------------------------------\n[router][riscv][add_liquidity]: 27,091,657,839\n[router][wasm] [add_liquidity]: 73,103,165,817\nSpeedup: 37%\n----------------------------------------\n[factory][riscv][get_pair]: 512,171,913\n[factory][wasm] [get_pair]: 569,226,744\nSpeedup: 90%\n----------------------------------------\n[psp22][riscv][balance_of]: 2,152,606,040\n[psp22][wasm] [balance_of]: 1,695,776,569\nSpeedup: 127%\n----------------------------------------\n[router][riscv][swap_exact_tokens]: 19,396,361,968\n[router][wasm] [swap_exact_tokens]: 51,087,540,671\nSpeedup: 38%\n```\n\n# Notes\n\n- You can edit [Dockerfile](Dockerfile) to use a different version of the toolchain.\nThen build image with `make build-image`.\nRemember also to remove old build files with `make clean`.\n- You may want to play a bit with [`polkadot-sdk`](polkadot-sdk) versions.\n\n# Problems\n\n1. We always use `cargo contract`.\nRunning `cargo +rve-nightly contract build` results in errors like:\n```\nerror[E0658]: use of unstable library feature 'stdsimd'\n  --\u003e /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/curve25519-dalek-4.1.2/src/backend/vector/ifma/field.rs:33:9\n   |\n33 |     use core::arch::x86_64::_mm256_madd52hi_epu64;\n   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: see issue #48556 \u003chttps://github.com/rust-lang/rust/issues/48556\u003e for more information\n   = help: add `#![feature(stdsimd)]` to the crate attributes to enable\n\nerror[E0635]: unknown feature `stdarch_x86_avx512`\n  --\u003e /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/curve25519-dalek-4.1.2/src/lib.rs:19:13\n   |\n19 |     feature(stdarch_x86_avx512)\n   |      \n...\n```\n2. We use `https://github.com/paritytech/rustc-rv32e-toolchain/releases/download/v1.0.0` instead of `https://github.com/paritytech/rustc-rv32e-toolchain/releases/download/v1.1.0`.\nThe newer version is failing even for flipper with:\n```\nERROR: Failed to link polkavm program: found control instruction at the end of block at \u003csection #9+760\u003e whose target doesn't resolve to any basic block:\nCall { ra: RA, target: SectionTarget { section_index: SectionIndex(22), offset: 0 }, target_return: SectionTarget { section_index: SectionIndex(9), offset: 780 } }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardinal-cryptography%2Fcontract-benchmarking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcardinal-cryptography%2Fcontract-benchmarking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardinal-cryptography%2Fcontract-benchmarking/lists"}