From 527df78287e325c5fc0223601c1b3623d9ce87b8 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Fri, 23 May 2025 12:04:04 +0200 Subject: [PATCH 01/13] ci: split benchmarks --- benchmarks/Cargo.lock | 992 ------------------ benchmarks/Cargo.toml | 15 + benchmarks/btreemap/canbench.yml | 3 + .../btreemap/canbench_results.yml | 462 +++----- .../{src/btreemap.rs => btreemap/src/main.rs} | 4 +- benchmarks/build.sh | 9 - benchmarks/candid.did | 0 benchmarks/dfx.json | 19 - benchmarks/memory_manager/canbench.yml | 3 + .../memory_manager/canbench_results.yml | 20 + .../src/main.rs} | 2 + benchmarks/src/{main.rs => common.rs} | 8 +- benchmarks/src/lib.rs | 1 + benchmarks/vec/canbench.yml | 3 + benchmarks/vec/canbench_results.yml | 98 ++ benchmarks/{src/vec.rs => vec/src/main.rs} | 4 +- canbench.yml | 5 - 17 files changed, 326 insertions(+), 1322 deletions(-) delete mode 100644 benchmarks/Cargo.lock create mode 100644 benchmarks/btreemap/canbench.yml rename canbench_results.yml => benchmarks/btreemap/canbench_results.yml (82%) rename benchmarks/{src/btreemap.rs => btreemap/src/main.rs} (99%) delete mode 100755 benchmarks/build.sh delete mode 100644 benchmarks/candid.did delete mode 100644 benchmarks/dfx.json create mode 100644 benchmarks/memory_manager/canbench.yml create mode 100644 benchmarks/memory_manager/canbench_results.yml rename benchmarks/{src/memory_manager.rs => memory_manager/src/main.rs} (99%) rename benchmarks/src/{main.rs => common.rs} (92%) create mode 100644 benchmarks/src/lib.rs create mode 100644 benchmarks/vec/canbench.yml create mode 100644 benchmarks/vec/canbench_results.yml rename benchmarks/{src/vec.rs => vec/src/main.rs} (98%) delete mode 100644 canbench.yml diff --git a/benchmarks/Cargo.lock b/benchmarks/Cargo.lock deleted file mode 100644 index 25e7c607..00000000 --- a/benchmarks/Cargo.lock +++ /dev/null @@ -1,992 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "0.7.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" -dependencies = [ - "memchr", -] - -[[package]] -name = "anyhow" -version = "1.0.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "ascii-canvas" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" -dependencies = [ - "term", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "beef" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" - -[[package]] -name = "benchmarks" -version = "0.1.0" -dependencies = [ - "ic-cdk", - "ic-cdk-macros", - "ic-stable-structures", - "tiny-rng", -] - -[[package]] -name = "binread" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16598dfc8e6578e9b597d9910ba2e73618385dc9f4b1d43dd92c349d6be6418f" -dependencies = [ - "binread_derive", - "lazy_static", - "rustversion", -] - -[[package]] -name = "binread_derive" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d9672209df1714ee804b1f4d4f68c8eb2a90b1f7a07acf472f88ce198ef1fed" -dependencies = [ - "either", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "block-buffer" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" -dependencies = [ - "generic-array", -] - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "candid" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "244005a1917bb7614cd775ca8a5d59efeb5ac74397bb14ba29a19347ebd78591" -dependencies = [ - "anyhow", - "binread", - "byteorder", - "candid_derive", - "codespan-reporting", - "crc32fast", - "data-encoding", - "hex", - "lalrpop", - "lalrpop-util", - "leb128", - "logos", - "num-bigint", - "num-traits", - "num_enum", - "paste", - "pretty", - "serde", - "serde_bytes", - "sha2", - "thiserror", -] - -[[package]] -name = "candid_derive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f1f4db7c7d04b87b70b3a35c5dc5c2c9dd73cef8bdf6760e2f18a0d45350dd" -dependencies = [ - "lazy_static", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "data-encoding" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" - -[[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "digest" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" -dependencies = [ - "block-buffer", - "crypto-common", -] - -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "ena" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7402b94a93c24e742487327a7cd839dc9d36fec9de9fb25b09f2dae459f36c3" -dependencies = [ - "log", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "generic-array" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "ic-cdk" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c98b304a2657bad15bcb547625a018e13cf596676d834cfd93023395a6e2e03a" -dependencies = [ - "candid", - "cfg-if", - "ic-cdk-macros", - "ic0", - "serde", - "serde_bytes", -] - -[[package]] -name = "ic-cdk-macros" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb423dab7c5bf19d4abccabd2ffe35e09b9dde611d478ea3afe0347b50fa727f" -dependencies = [ - "candid", - "proc-macro2", - "quote", - "serde", - "serde_tokenstream", - "syn", -] - -[[package]] -name = "ic-stable-structures" -version = "0.5.2" - -[[package]] -name = "ic0" -version = "0.18.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978b91fc78de9d2eb0144db717839cde3b35470199ea51aca362cb6310e93dfd" - -[[package]] -name = "indexmap" -version = "1.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" -dependencies = [ - "autocfg", - "hashbrown", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "lalrpop" -version = "0.19.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30455341b0e18f276fa64540aff54deafb54c589de6aca68659c63dd2d5d823" -dependencies = [ - "ascii-canvas", - "atty", - "bit-set", - "diff", - "ena", - "itertools", - "lalrpop-util", - "petgraph", - "pico-args", - "regex", - "regex-syntax", - "string_cache", - "term", - "tiny-keccak", - "unicode-xid", -] - -[[package]] -name = "lalrpop-util" -version = "0.19.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf796c978e9b4d983414f4caedc9273aa33ee214c5b887bd55fde84c85d2dc4" -dependencies = [ - "regex", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "leb128" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" - -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - -[[package]] -name = "lock_api" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "logos" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf8b031682c67a8e3d5446840f9573eb7fe26efe7ec8d195c9ac4c0647c502f1" -dependencies = [ - "logos-derive", -] - -[[package]] -name = "logos-derive" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d849148dbaf9661a6151d1ca82b13bb4c4c128146a88d05253b38d4e2f496c" -dependencies = [ - "beef", - "fnv", - "proc-macro2", - "quote", - "regex-syntax", - "syn", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "new_debug_unreachable" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" - -[[package]] -name = "nom8" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" -dependencies = [ - "memchr", -] - -[[package]] -name = "num-bigint" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", - "serde", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_enum" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d829733185c1ca374f17e52b762f24f535ec625d2cc1f070e34c8a9068f341b" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2be1598bf1c313dcdd12092e3f1920f463462525a21b7b4e11b4168353d0123e" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-sys", -] - -[[package]] -name = "paste" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" - -[[package]] -name = "petgraph" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" -dependencies = [ - "fixedbitset", - "indexmap", -] - -[[package]] -name = "phf_shared" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pico-args" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468" - -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - -[[package]] -name = "pretty" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad9940b913ee56ddd94aec2d3cd179dd47068236f42a1a6415ccf9d880ce2a61" -dependencies = [ - "arrayvec", - "typed-arena", -] - -[[package]] -name = "proc-macro-crate" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66618389e4ec1c7afe67d51a9bf34ff9236480f8d51e7489b7d5ab0303c13f34" -dependencies = [ - "once_cell", - "toml_edit", -] - -[[package]] -name = "proc-macro2" -version = "1.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_users" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" -dependencies = [ - "getrandom", - "redox_syscall", - "thiserror", -] - -[[package]] -name = "regex" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" - -[[package]] -name = "rustversion" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "serde" -version = "1.0.152" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_bytes" -version = "0.11.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718dc5fff5b36f99093fc49b280cfc96ce6fc824317783bff5a1fed0c7a64819" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.152" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_tokenstream" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "274f512d6748a01e67cbcde5b4307ab2c9d52a98a2b870a980ef0793a351deff" -dependencies = [ - "proc-macro2", - "serde", - "syn", -] - -[[package]] -name = "sha2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "siphasher" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "string_cache" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213494b7a2b503146286049378ce02b482200519accc31872ee8be91fa820a08" -dependencies = [ - "new_debug_unreachable", - "once_cell", - "parking_lot", - "phf_shared", - "precomputed-hash", -] - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "term" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" -dependencies = [ - "dirs-next", - "rustversion", - "winapi", -] - -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - -[[package]] -name = "tiny-rng" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d63628286617a0c67ee3c4ef92ccf62044e3813ed7376bb82a4586d2ff7974dd" - -[[package]] -name = "toml_datetime" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5" - -[[package]] -name = "toml_edit" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729bfd096e40da9c001f778f5cdecbd2957929a24e10e5883d9392220a751581" -dependencies = [ - "indexmap", - "nom8", - "toml_datetime", -] - -[[package]] -name = "typed-arena" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" - -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index 3cf85d6f..841c20c0 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -14,3 +14,18 @@ ic-stable-structures = { path = "../", features = [] } maplit = "1.0.2" serde = "1.0" tiny-rng = "0.2.0" + +[lib] +path = "src/lib.rs" + +[[bin]] +name = "btreemap" +path = "btreemap/src/main.rs" + +[[bin]] +name = "vec" +path = "vec/src/main.rs" + +[[bin]] +name = "memory_manager" +path = "memory_manager/src/main.rs" diff --git a/benchmarks/btreemap/canbench.yml b/benchmarks/btreemap/canbench.yml new file mode 100644 index 00000000..906dc15c --- /dev/null +++ b/benchmarks/btreemap/canbench.yml @@ -0,0 +1,3 @@ +build_cmd: cargo build -p benchmarks --release --target wasm32-unknown-unknown + +wasm_path: ./../../target/wasm32-unknown-unknown/release/btreemap.wasm diff --git a/canbench_results.yml b/benchmarks/btreemap/canbench_results.yml similarity index 82% rename from canbench_results.yml rename to benchmarks/btreemap/canbench_results.yml index ea633ec7..3bfd2fb0 100644 --- a/canbench_results.yml +++ b/benchmarks/btreemap/canbench_results.yml @@ -481,241 +481,241 @@ benches: scopes: {} btreemap_v2_insert_10mib_values: total: - instructions: 5235942268 + instructions: 5251792407 heap_increase: 322 stable_memory_increase: 3613 scopes: {} btreemap_v2_insert_blob8_u64: total: - instructions: 447881281 + instructions: 451032099 heap_increase: 0 stable_memory_increase: 4 scopes: {} btreemap_v2_insert_blob_1024_128: total: - instructions: 5522417615 + instructions: 5525788621 heap_increase: 0 stable_memory_increase: 196 scopes: {} btreemap_v2_insert_blob_128_128: total: - instructions: 1205447826 + instructions: 1208821721 heap_increase: 0 stable_memory_increase: 46 scopes: {} btreemap_v2_insert_blob_16_128: total: - instructions: 497322694 + instructions: 500591507 heap_increase: 0 stable_memory_increase: 24 scopes: {} btreemap_v2_insert_blob_256_128: total: - instructions: 1814060369 + instructions: 1817436954 heap_increase: 0 stable_memory_increase: 67 scopes: {} btreemap_v2_insert_blob_32_1024: total: - instructions: 721539147 + instructions: 724849513 heap_increase: 0 stable_memory_increase: 173 scopes: {} btreemap_v2_insert_blob_32_128: total: - instructions: 560214330 + instructions: 563513818 heap_increase: 0 stable_memory_increase: 28 scopes: {} btreemap_v2_insert_blob_32_16: total: - instructions: 536081224 + instructions: 539411391 heap_increase: 0 stable_memory_increase: 11 scopes: {} btreemap_v2_insert_blob_32_256: total: - instructions: 589601127 + instructions: 592917949 heap_increase: 0 stable_memory_increase: 49 scopes: {} btreemap_v2_insert_blob_32_32: total: - instructions: 546883904 + instructions: 550204851 heap_increase: 0 stable_memory_increase: 13 scopes: {} btreemap_v2_insert_blob_32_4: total: - instructions: 526741522 + instructions: 530054245 heap_increase: 0 stable_memory_increase: 8 scopes: {} btreemap_v2_insert_blob_32_512: total: - instructions: 628023289 + instructions: 631334643 heap_increase: 0 stable_memory_increase: 91 scopes: {} btreemap_v2_insert_blob_32_64: total: - instructions: 553130892 + instructions: 556446414 heap_increase: 0 stable_memory_increase: 18 scopes: {} btreemap_v2_insert_blob_32_8: total: - instructions: 535393971 + instructions: 538691050 heap_increase: 0 stable_memory_increase: 9 scopes: {} btreemap_v2_insert_blob_4_128: total: - instructions: 418057064 + instructions: 421160969 heap_increase: 0 stable_memory_increase: 13 scopes: {} btreemap_v2_insert_blob_512_128: total: - instructions: 3066989201 + instructions: 3070369275 heap_increase: 0 stable_memory_increase: 111 scopes: {} btreemap_v2_insert_blob_64_128: total: - instructions: 683865403 + instructions: 687224483 heap_increase: 0 stable_memory_increase: 34 scopes: {} btreemap_v2_insert_blob_8_128: total: - instructions: 469975063 + instructions: 473325573 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_u64_blob8: total: - instructions: 422220035 + instructions: 424856493 heap_increase: 0 stable_memory_increase: 5 scopes: {} btreemap_v2_insert_u64_u64: total: - instructions: 430448129 + instructions: 433078325 heap_increase: 0 stable_memory_increase: 6 scopes: {} btreemap_v2_insert_u64_vec8: total: - instructions: 430971218 + instructions: 433606277 heap_increase: 0 stable_memory_increase: 21 scopes: {} btreemap_v2_insert_vec8_u64: total: - instructions: 593488226 + instructions: 596675648 heap_increase: 0 stable_memory_increase: 16 scopes: {} btreemap_v2_insert_vec_1024_128: total: - instructions: 2788964013 + instructions: 2791324758 heap_increase: 0 stable_memory_increase: 193 scopes: {} btreemap_v2_insert_vec_128_128: total: - instructions: 1040666127 + instructions: 1043141922 heap_increase: 0 stable_memory_increase: 51 scopes: {} btreemap_v2_insert_vec_16_128: total: - instructions: 716528048 + instructions: 719668306 heap_increase: 0 stable_memory_increase: 31 scopes: {} btreemap_v2_insert_vec_256_128: total: - instructions: 1423229579 + instructions: 1425303707 heap_increase: 0 stable_memory_increase: 71 scopes: {} btreemap_v2_insert_vec_32_1024: total: - instructions: 1241911609 + instructions: 1245182311 heap_increase: 0 stable_memory_increase: 171 scopes: {} btreemap_v2_insert_vec_32_128: total: - instructions: 780562374 + instructions: 783650016 heap_increase: 0 stable_memory_increase: 33 scopes: {} btreemap_v2_insert_vec_32_16: total: - instructions: 685367835 + instructions: 688714472 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_vec_32_256: total: - instructions: 905182779 + instructions: 908090397 heap_increase: 0 stable_memory_increase: 54 scopes: {} btreemap_v2_insert_vec_32_32: total: - instructions: 681093828 + instructions: 684433845 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_vec_32_4: total: - instructions: 680050783 + instructions: 683382632 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_vec_32_512: total: - instructions: 1023501139 + instructions: 1026429795 heap_increase: 0 stable_memory_increase: 91 scopes: {} btreemap_v2_insert_vec_32_64: total: - instructions: 713787802 + instructions: 717127986 heap_increase: 0 stable_memory_increase: 24 scopes: {} btreemap_v2_insert_vec_32_8: total: - instructions: 679379848 + instructions: 682695835 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_vec_4_128: total: - instructions: 618554697 + instructions: 621403098 heap_increase: 0 stable_memory_increase: 16 scopes: {} btreemap_v2_insert_vec_512_128: total: - instructions: 1900951170 + instructions: 1902984654 heap_increase: 0 stable_memory_increase: 112 scopes: {} btreemap_v2_insert_vec_64_128: total: - instructions: 871501114 + instructions: 874468580 heap_increase: 0 stable_memory_increase: 41 scopes: {} btreemap_v2_insert_vec_8_128: total: - instructions: 677475745 + instructions: 680539915 heap_increase: 0 stable_memory_increase: 23 scopes: {} @@ -733,19 +733,19 @@ benches: scopes: {} btreemap_v2_mem_manager_contains_u64_u64: total: - instructions: 306649304 + instructions: 306627813 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_contains_u64_vec512: total: - instructions: 390370858 + instructions: 389757735 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_contains_vec512_u64: total: - instructions: 1262177337 + instructions: 1263289433 heap_increase: 0 stable_memory_increase: 0 scopes: {} @@ -763,547 +763,547 @@ benches: scopes: {} btreemap_v2_mem_manager_get_u64_u64: total: - instructions: 319774791 + instructions: 319753690 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_get_u64_vec512: total: - instructions: 417383478 + instructions: 416829254 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_get_vec512_u64: total: - instructions: 1305921836 + instructions: 1307093926 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_insert_blob512_u64: total: - instructions: 3188220437 + instructions: 3189283496 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_insert_u64_blob512: total: - instructions: 646180538 + instructions: 647090913 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_insert_u64_u64: total: - instructions: 559686196 + instructions: 560416015 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_insert_u64_vec512: total: - instructions: 900244746 + instructions: 900560610 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_insert_vec512_u64: total: - instructions: 2030007104 + instructions: 2032213938 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_remove_blob512_u64: total: - instructions: 4409760599 + instructions: 4412188232 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_remove_u64_blob512: total: - instructions: 948683605 + instructions: 950509462 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_remove_u64_u64: total: - instructions: 806471492 + instructions: 808272554 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_remove_u64_vec512: total: - instructions: 1288322168 + instructions: 1289646672 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_remove_vec512_u64: total: - instructions: 3180357322 + instructions: 3183910600 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob8_u64: total: - instructions: 618149965 + instructions: 622200612 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_1024_128: total: - instructions: 8426240976 + instructions: 8431485307 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_128_128: total: - instructions: 1863629590 + instructions: 1868788894 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_16_128: total: - instructions: 761301140 + instructions: 765976330 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_256_128: total: - instructions: 2801910688 + instructions: 2807125758 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_1024: total: - instructions: 1146780971 + instructions: 1151786001 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_128: total: - instructions: 890225887 + instructions: 895271311 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_16: total: - instructions: 825218804 + instructions: 830179002 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_256: total: - instructions: 918990755 + instructions: 924008110 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_32: total: - instructions: 839977694 + instructions: 844939938 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_4: total: - instructions: 808460660 + instructions: 813445759 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_512: total: - instructions: 983671503 + instructions: 988660805 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_64: total: - instructions: 848705110 + instructions: 853670229 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_8: total: - instructions: 826773859 + instructions: 831827205 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_4_128: total: - instructions: 380309990 + instructions: 382997165 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_512_128: total: - instructions: 4651382667 + instructions: 4656589098 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_64_128: total: - instructions: 1065173359 + instructions: 1070297879 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_8_128: total: - instructions: 622213520 + instructions: 626229705 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_u64_blob8: total: - instructions: 700537150 + instructions: 704655929 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_u64_u64: total: - instructions: 712190273 + instructions: 716277144 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_u64_vec8: total: - instructions: 703089020 + instructions: 707209315 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec8_u64: total: - instructions: 794337993 + instructions: 798415675 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_1024_128: total: - instructions: 4084712198 + instructions: 4088132403 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_128_128: total: - instructions: 1536344151 + instructions: 1540235590 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_16_128: total: - instructions: 1034269421 + instructions: 1038779439 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_256_128: total: - instructions: 2054975331 + instructions: 2058259559 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_1024: total: - instructions: 1715732916 + instructions: 1720412111 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_128: total: - instructions: 1116978776 + instructions: 1121742435 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_16: total: - instructions: 960050241 + instructions: 965011196 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_256: total: - instructions: 1243756132 + instructions: 1248136176 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_32: total: - instructions: 956192431 + instructions: 961152867 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_4: total: - instructions: 949470088 + instructions: 954455322 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_512: total: - instructions: 1399777559 + instructions: 1404132603 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_64: total: - instructions: 1000150610 + instructions: 1005109163 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_8: total: - instructions: 960712444 + instructions: 965763851 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_4_128: total: - instructions: 543972754 + instructions: 546598470 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_512_128: total: - instructions: 2753463277 + instructions: 2756486256 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_64_128: total: - instructions: 1261402194 + instructions: 1266073861 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_8_128: total: - instructions: 855954019 + instructions: 859841365 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob8_u64: total: - instructions: 598288574 + instructions: 602347040 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_1024_128: total: - instructions: 8109415496 + instructions: 8114668990 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_128_128: total: - instructions: 1797385897 + instructions: 1802553209 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_16_128: total: - instructions: 737329012 + instructions: 742006768 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_256_128: total: - instructions: 2713198089 + instructions: 2718413551 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_1024: total: - instructions: 1112675292 + instructions: 1117676356 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_128: total: - instructions: 857685748 + instructions: 862736779 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_16: total: - instructions: 800650933 + instructions: 805611946 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_256: total: - instructions: 890480209 + instructions: 895496990 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_32: total: - instructions: 810590785 + instructions: 815542515 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_4: total: - instructions: 788644075 + instructions: 793647231 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_512: total: - instructions: 960247599 + instructions: 965231963 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_64: total: - instructions: 824986291 + instructions: 829954994 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_8: total: - instructions: 802282038 + instructions: 807341789 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_4_128: total: - instructions: 368947012 + instructions: 371628594 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_512_128: total: - instructions: 4491955816 + instructions: 4497163450 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_64_128: total: - instructions: 1036824265 + instructions: 1041943724 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_8_128: total: - instructions: 618217334 + instructions: 622232883 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_u64_blob8: total: - instructions: 681642507 + instructions: 685762799 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_u64_u64: total: - instructions: 693044274 + instructions: 697134661 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_u64_vec8: total: - instructions: 683926309 + instructions: 688048690 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec8_u64: total: - instructions: 771729448 + instructions: 775814592 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_1024_128: total: - instructions: 4311367464 + instructions: 4314793480 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_128_128: total: - instructions: 1550311560 + instructions: 1554207920 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_16_128: total: - instructions: 1021597436 + instructions: 1026108704 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_256_128: total: - instructions: 2128674539 + instructions: 2131957972 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_1024: total: - instructions: 1698447535 + instructions: 1703124975 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_128: total: - instructions: 1098011297 + instructions: 1102777836 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_16: total: - instructions: 939250020 + instructions: 944211577 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_256: total: - instructions: 1226704397 + instructions: 1231083612 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_32: total: - instructions: 938142634 + instructions: 943092696 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_4: total: - instructions: 935353100 + instructions: 940356611 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_512: total: - instructions: 1390117044 + instructions: 1394468402 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_64: total: - instructions: 981585565 + instructions: 986545819 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_8: total: - instructions: 938800934 + instructions: 943858683 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_4_128: total: - instructions: 533817212 + instructions: 536437375 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_512_128: total: - instructions: 2873026098 + instructions: 2876049565 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_64_128: total: - instructions: 1254022302 + instructions: 1258690701 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_8_128: total: - instructions: 861806611 + instructions: 865694092 heap_increase: 0 stable_memory_increase: 0 scopes: {} @@ -1363,241 +1363,241 @@ benches: scopes: {} btreemap_v2_remove_10mib_values: total: - instructions: 4722318553 + instructions: 4737371947 heap_increase: 0 stable_memory_increase: 657 scopes: {} btreemap_v2_remove_blob8_u64: total: - instructions: 600630132 + instructions: 606056707 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_1024_128: total: - instructions: 7415359343 + instructions: 7421888860 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_128_128: total: - instructions: 1628874474 + instructions: 1635342141 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_16_128: total: - instructions: 684610503 + instructions: 690775084 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_256_128: total: - instructions: 2462815709 + instructions: 2469317743 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_1024: total: - instructions: 1011836417 + instructions: 1018120602 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_128: total: - instructions: 776121815 + instructions: 782398052 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_16: total: - instructions: 729483435 + instructions: 735719716 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_256: total: - instructions: 812632815 + instructions: 818891028 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_32: total: - instructions: 740922807 + instructions: 747183761 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_4: total: - instructions: 725865405 + instructions: 732221308 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_512: total: - instructions: 885071370 + instructions: 891432147 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_64: total: - instructions: 767661424 + instructions: 774120259 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_8: total: - instructions: 725879178 + instructions: 732105852 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_4_128: total: - instructions: 464283644 + instructions: 468000923 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_512_128: total: - instructions: 4116359190 + instructions: 4122884694 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_64_128: total: - instructions: 944002054 + instructions: 950218273 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_8_128: total: - instructions: 617996656 + instructions: 623528280 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_u64_blob8: total: - instructions: 596635327 + instructions: 601729360 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_u64_u64: total: - instructions: 618817776 + instructions: 623942719 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_u64_vec8: total: - instructions: 602624309 + instructions: 607719704 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec8_u64: total: - instructions: 761632935 + instructions: 767231402 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_1024_128: total: - instructions: 4553964491 + instructions: 4558259608 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_128_128: total: - instructions: 1456648411 + instructions: 1461626992 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_16_128: total: - instructions: 923173767 + instructions: 929190127 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_256_128: total: - instructions: 2286348225 + instructions: 2290487520 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_1024: total: - instructions: 1725908127 + instructions: 1731690536 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_128: total: - instructions: 1062607331 + instructions: 1068571014 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_16: total: - instructions: 885192472 + instructions: 891426398 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_256: total: - instructions: 1273590765 + instructions: 1279117437 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_32: total: - instructions: 892627036 + instructions: 898887519 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_4: total: - instructions: 891606025 + instructions: 897962083 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_512: total: - instructions: 1438443895 + instructions: 1443964170 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_64: total: - instructions: 972956178 + instructions: 979405967 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_8: total: - instructions: 885742038 + instructions: 892013370 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_4_128: total: - instructions: 665339043 + instructions: 669117031 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_512_128: total: - instructions: 3123529322 + instructions: 3127395736 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_64_128: total: - instructions: 1183067683 + instructions: 1188794435 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_8_128: total: - instructions: 832533102 + instructions: 837942730 heap_increase: 0 stable_memory_increase: 0 scopes: {} @@ -1709,118 +1709,4 @@ benches: heap_increase: 0 stable_memory_increase: 0 scopes: {} - memory_manager_baseline: - total: - instructions: 1176577076 - heap_increase: 0 - stable_memory_increase: 8000 - scopes: {} - memory_manager_grow: - total: - instructions: 346537961 - heap_increase: 2 - stable_memory_increase: 32000 - scopes: {} - memory_manager_overhead: - total: - instructions: 1181962837 - heap_increase: 0 - stable_memory_increase: 8320 - scopes: {} - vec_get_blob_128: - total: - instructions: 19246658 - heap_increase: 0 - stable_memory_increase: 0 - scopes: {} - vec_get_blob_16: - total: - instructions: 6405942 - heap_increase: 0 - stable_memory_increase: 0 - scopes: {} - vec_get_blob_32: - total: - instructions: 7123501 - heap_increase: 0 - stable_memory_increase: 0 - scopes: {} - vec_get_blob_4: - total: - instructions: 4824323 - heap_increase: 0 - stable_memory_increase: 0 - scopes: {} - vec_get_blob_4_mem_manager: - total: - instructions: 7191673 - heap_increase: 0 - stable_memory_increase: 0 - scopes: {} - vec_get_blob_64: - total: - instructions: 11310940 - heap_increase: 0 - stable_memory_increase: 0 - scopes: {} - vec_get_blob_64_mem_manager: - total: - instructions: 13651088 - heap_increase: 0 - stable_memory_increase: 0 - scopes: {} - vec_get_blob_8: - total: - instructions: 5723197 - heap_increase: 0 - stable_memory_increase: 0 - scopes: {} - vec_get_u64: - total: - instructions: 4790302 - heap_increase: 0 - stable_memory_increase: 0 - scopes: {} - vec_insert_blob_128: - total: - instructions: 4131421 - heap_increase: 0 - stable_memory_increase: 19 - scopes: {} - vec_insert_blob_16: - total: - instructions: 3296224 - heap_increase: 0 - stable_memory_increase: 2 - scopes: {} - vec_insert_blob_32: - total: - instructions: 3415464 - heap_increase: 0 - stable_memory_increase: 5 - scopes: {} - vec_insert_blob_4: - total: - instructions: 3207465 - heap_increase: 0 - stable_memory_increase: 0 - scopes: {} - vec_insert_blob_64: - total: - instructions: 3655801 - heap_increase: 0 - stable_memory_increase: 9 - scopes: {} - vec_insert_blob_8: - total: - instructions: 3236886 - heap_increase: 0 - stable_memory_increase: 1 - scopes: {} - vec_insert_u64: - total: - instructions: 5859516 - heap_increase: 0 - stable_memory_increase: 1 - scopes: {} version: 0.1.14 diff --git a/benchmarks/src/btreemap.rs b/benchmarks/btreemap/src/main.rs similarity index 99% rename from benchmarks/src/btreemap.rs rename to benchmarks/btreemap/src/main.rs index 45d3cbe4..6c348ca2 100644 --- a/benchmarks/src/btreemap.rs +++ b/benchmarks/btreemap/src/main.rs @@ -1,4 +1,4 @@ -use crate::Random; +use benchmarks::common::Random; use canbench_rs::{bench, bench_fn, BenchResult}; use ic_stable_structures::memory_manager::{MemoryId, MemoryManager}; use ic_stable_structures::{ @@ -784,3 +784,5 @@ fn range_count_helper_v2(count: usize, size: usize) -> BenchResult { .count() }) } + +fn main() {} diff --git a/benchmarks/build.sh b/benchmarks/build.sh deleted file mode 100755 index 9f9ea763..00000000 --- a/benchmarks/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -set -Eexuo pipefail - -# Move to the script directory. -SCRIPT_DIR=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd) -pushd "$SCRIPT_DIR" - -cargo build --release --target wasm32-unknown-unknown -gzip -n -f ../target/wasm32-unknown-unknown/release/benchmarks.wasm diff --git a/benchmarks/candid.did b/benchmarks/candid.did deleted file mode 100644 index e69de29b..00000000 diff --git a/benchmarks/dfx.json b/benchmarks/dfx.json deleted file mode 100644 index 770d2bcf..00000000 --- a/benchmarks/dfx.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "dfx": "0.14.3", - "canisters": { - "benchmarks": { - "candid": "candid.did", - "package": "benchmarks", - "type": "custom", - "build": "bash build.sh", - "wasm": "../target/wasm32-unknown-unknown/release/benchmarks.wasm.gz" - } - }, - "defaults": { - "build": { - "args": "", - "packtool": "" - } - }, - "version": 1 -} diff --git a/benchmarks/memory_manager/canbench.yml b/benchmarks/memory_manager/canbench.yml new file mode 100644 index 00000000..81b4875b --- /dev/null +++ b/benchmarks/memory_manager/canbench.yml @@ -0,0 +1,3 @@ +build_cmd: cargo build -p benchmarks --release --target wasm32-unknown-unknown + +wasm_path: ./../../target/wasm32-unknown-unknown/release/memory_manager.wasm diff --git a/benchmarks/memory_manager/canbench_results.yml b/benchmarks/memory_manager/canbench_results.yml new file mode 100644 index 00000000..8b1977ec --- /dev/null +++ b/benchmarks/memory_manager/canbench_results.yml @@ -0,0 +1,20 @@ +benches: + memory_manager_baseline: + total: + instructions: 1176577076 + heap_increase: 0 + stable_memory_increase: 8000 + scopes: {} + memory_manager_grow: + total: + instructions: 347433963 + heap_increase: 2 + stable_memory_increase: 32000 + scopes: {} + memory_manager_overhead: + total: + instructions: 1181977502 + heap_increase: 0 + stable_memory_increase: 8320 + scopes: {} +version: 0.1.14 diff --git a/benchmarks/src/memory_manager.rs b/benchmarks/memory_manager/src/main.rs similarity index 99% rename from benchmarks/src/memory_manager.rs rename to benchmarks/memory_manager/src/main.rs index ecbb999b..783e896e 100644 --- a/benchmarks/src/memory_manager.rs +++ b/benchmarks/memory_manager/src/main.rs @@ -72,3 +72,5 @@ pub fn memory_manager_grow() -> BenchResult { } }) } + +fn main() {} diff --git a/benchmarks/src/main.rs b/benchmarks/src/common.rs similarity index 92% rename from benchmarks/src/main.rs rename to benchmarks/src/common.rs index 93f2b86a..b7041181 100644 --- a/benchmarks/src/main.rs +++ b/benchmarks/src/common.rs @@ -1,11 +1,7 @@ use ic_stable_structures::storable::{Blob, FixedVec, Storable}; use tiny_rng::{Rand, Rng}; -mod btreemap; -mod memory_manager; -mod vec; - -trait Random { +pub trait Random { fn random(rng: &mut Rng) -> Self; } @@ -38,5 +34,3 @@ impl Random for u64 { rng.rand_u64() } } - -fn main() {} diff --git a/benchmarks/src/lib.rs b/benchmarks/src/lib.rs new file mode 100644 index 00000000..34994bf5 --- /dev/null +++ b/benchmarks/src/lib.rs @@ -0,0 +1 @@ +pub mod common; diff --git a/benchmarks/vec/canbench.yml b/benchmarks/vec/canbench.yml new file mode 100644 index 00000000..a7a317d8 --- /dev/null +++ b/benchmarks/vec/canbench.yml @@ -0,0 +1,3 @@ +build_cmd: cargo build -p benchmarks --release --target wasm32-unknown-unknown + +wasm_path: ./../../target/wasm32-unknown-unknown/release/vec.wasm diff --git a/benchmarks/vec/canbench_results.yml b/benchmarks/vec/canbench_results.yml new file mode 100644 index 00000000..98beff16 --- /dev/null +++ b/benchmarks/vec/canbench_results.yml @@ -0,0 +1,98 @@ +benches: + vec_get_blob_128: + total: + instructions: 19246658 + heap_increase: 0 + stable_memory_increase: 0 + scopes: {} + vec_get_blob_16: + total: + instructions: 6405942 + heap_increase: 0 + stable_memory_increase: 0 + scopes: {} + vec_get_blob_32: + total: + instructions: 7123501 + heap_increase: 0 + stable_memory_increase: 0 + scopes: {} + vec_get_blob_4: + total: + instructions: 4824323 + heap_increase: 0 + stable_memory_increase: 0 + scopes: {} + vec_get_blob_4_mem_manager: + total: + instructions: 7191673 + heap_increase: 0 + stable_memory_increase: 0 + scopes: {} + vec_get_blob_64: + total: + instructions: 11310940 + heap_increase: 0 + stable_memory_increase: 0 + scopes: {} + vec_get_blob_64_mem_manager: + total: + instructions: 13651088 + heap_increase: 0 + stable_memory_increase: 0 + scopes: {} + vec_get_blob_8: + total: + instructions: 5723197 + heap_increase: 0 + stable_memory_increase: 0 + scopes: {} + vec_get_u64: + total: + instructions: 4790302 + heap_increase: 0 + stable_memory_increase: 0 + scopes: {} + vec_insert_blob_128: + total: + instructions: 4151421 + heap_increase: 0 + stable_memory_increase: 19 + scopes: {} + vec_insert_blob_16: + total: + instructions: 3316224 + heap_increase: 0 + stable_memory_increase: 2 + scopes: {} + vec_insert_blob_32: + total: + instructions: 3435464 + heap_increase: 0 + stable_memory_increase: 5 + scopes: {} + vec_insert_blob_4: + total: + instructions: 3227465 + heap_increase: 0 + stable_memory_increase: 0 + scopes: {} + vec_insert_blob_64: + total: + instructions: 3675801 + heap_increase: 0 + stable_memory_increase: 9 + scopes: {} + vec_insert_blob_8: + total: + instructions: 3256886 + heap_increase: 0 + stable_memory_increase: 1 + scopes: {} + vec_insert_u64: + total: + instructions: 5869516 + heap_increase: 0 + stable_memory_increase: 1 + scopes: {} +version: 0.1.14 diff --git a/benchmarks/src/vec.rs b/benchmarks/vec/src/main.rs similarity index 98% rename from benchmarks/src/vec.rs rename to benchmarks/vec/src/main.rs index 4a0475bb..1fda433e 100644 --- a/benchmarks/src/vec.rs +++ b/benchmarks/vec/src/main.rs @@ -1,4 +1,4 @@ -use crate::Random; +use benchmarks::common::Random; use canbench_rs::{bench, bench_fn, BenchResult}; use ic_stable_structures::memory_manager::{MemoryId, MemoryManager}; use ic_stable_structures::storable::Blob; @@ -132,3 +132,5 @@ fn vec_get(memory: impl Memory) -> BenchResult { } }) } + +fn main() {} diff --git a/canbench.yml b/canbench.yml deleted file mode 100644 index 6ebc7258..00000000 --- a/canbench.yml +++ /dev/null @@ -1,5 +0,0 @@ -build_cmd: - cargo build -p benchmarks --release --target wasm32-unknown-unknown - -wasm_path: - ./target/wasm32-unknown-unknown/release/benchmarks.wasm From c3dfbda24fc59cbb43a0b2b0628e259621079e59 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Fri, 23 May 2025 12:05:38 +0200 Subject: [PATCH 02/13] . --- benchmarks/Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index 841c20c0..395463dc 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -22,10 +22,10 @@ path = "src/lib.rs" name = "btreemap" path = "btreemap/src/main.rs" -[[bin]] -name = "vec" -path = "vec/src/main.rs" - [[bin]] name = "memory_manager" path = "memory_manager/src/main.rs" + +[[bin]] +name = "vec" +path = "vec/src/main.rs" From 4a100ff11be19ebbf46c6f16218a422fbe2d3d6e Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Fri, 23 May 2025 12:08:22 +0200 Subject: [PATCH 03/13] update ci.yml --- .github/workflows/ci.yml | 116 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 114 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81480cbf..da482958 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,11 +79,123 @@ jobs: run: | bash examples/test.sh - benchmark: + benchmark-btreemap: runs-on: ubuntu-latest needs: build env: - PROJECT_DIR: . + PROJECT_DIR: ./benchmarks/btreemap + steps: + - name: Checkout current PR + uses: actions/checkout@v4 + + - name: Checkout main branch + uses: actions/checkout@v4 + with: + ref: main + path: _canbench_main_branch + + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-1 + + - name: Install Rust + run: | + rustup update ${{ matrix.rust }} --no-self-update + rustup default ${{ matrix.rust }} + rustup target add wasm32-unknown-unknown + + - name: Benchmark + run: | + bash ./scripts/ci_run_benchmark.sh $PROJECT_DIR ${{ github.job }} + + - uses: actions/upload-artifact@v4 + with: + name: canbench_result_${{github.job}} + path: /tmp/canbench_result_${{ github.job }} + + - uses: actions/upload-artifact@v4 + with: + name: canbench_results_${{github.job}}_csv + path: /tmp/canbench_results_${{ github.job }}.csv + + - name: Save PR number + run: | + echo ${{ github.event.number }} > /tmp/pr_number + + - uses: actions/upload-artifact@v4 + with: + name: pr_number + path: /tmp/pr_number + + - name: Pass or fail + run: | + bash ./scripts/ci_post_run_benchmark.sh + + benchmark-memory-manager: + runs-on: ubuntu-latest + needs: build + env: + PROJECT_DIR: ./benchmarks/memory_manager + steps: + - name: Checkout current PR + uses: actions/checkout@v4 + + - name: Checkout main branch + uses: actions/checkout@v4 + with: + ref: main + path: _canbench_main_branch + + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-1 + + - name: Install Rust + run: | + rustup update ${{ matrix.rust }} --no-self-update + rustup default ${{ matrix.rust }} + rustup target add wasm32-unknown-unknown + + - name: Benchmark + run: | + bash ./scripts/ci_run_benchmark.sh $PROJECT_DIR ${{ github.job }} + + - uses: actions/upload-artifact@v4 + with: + name: canbench_result_${{github.job}} + path: /tmp/canbench_result_${{ github.job }} + + - uses: actions/upload-artifact@v4 + with: + name: canbench_results_${{github.job}}_csv + path: /tmp/canbench_results_${{ github.job }}.csv + + - name: Save PR number + run: | + echo ${{ github.event.number }} > /tmp/pr_number + + - uses: actions/upload-artifact@v4 + with: + name: pr_number + path: /tmp/pr_number + + - name: Pass or fail + run: | + bash ./scripts/ci_post_run_benchmark.sh + + benchmark-vec: + runs-on: ubuntu-latest + needs: build + env: + PROJECT_DIR: ./benchmarks/vec steps: - name: Checkout current PR uses: actions/checkout@v4 From 89c32874e58ea378b857ebc229ca06847003897a Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Fri, 23 May 2025 12:12:51 +0200 Subject: [PATCH 04/13] pr_number --- .github/workflows/ci.yml | 42 ++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da482958..529e2101 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,6 +79,21 @@ jobs: run: | bash examples/test.sh + upload-pr-number: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Save PR number + run: | + echo ${{ github.event.number }} > /tmp/pr_number + + - uses: actions/upload-artifact@v4 + with: + name: pr_number + path: /tmp/pr_number + benchmark-btreemap: runs-on: ubuntu-latest needs: build @@ -122,15 +137,6 @@ jobs: name: canbench_results_${{github.job}}_csv path: /tmp/canbench_results_${{ github.job }}.csv - - name: Save PR number - run: | - echo ${{ github.event.number }} > /tmp/pr_number - - - uses: actions/upload-artifact@v4 - with: - name: pr_number - path: /tmp/pr_number - - name: Pass or fail run: | bash ./scripts/ci_post_run_benchmark.sh @@ -178,15 +184,6 @@ jobs: name: canbench_results_${{github.job}}_csv path: /tmp/canbench_results_${{ github.job }}.csv - - name: Save PR number - run: | - echo ${{ github.event.number }} > /tmp/pr_number - - - uses: actions/upload-artifact@v4 - with: - name: pr_number - path: /tmp/pr_number - - name: Pass or fail run: | bash ./scripts/ci_post_run_benchmark.sh @@ -234,15 +231,6 @@ jobs: name: canbench_results_${{github.job}}_csv path: /tmp/canbench_results_${{ github.job }}.csv - - name: Save PR number - run: | - echo ${{ github.event.number }} > /tmp/pr_number - - - uses: actions/upload-artifact@v4 - with: - name: pr_number - path: /tmp/pr_number - - name: Pass or fail run: | bash ./scripts/ci_post_run_benchmark.sh From d636ba5de8a9770bf5e1a258dfbc1d74913a68ff Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Fri, 23 May 2025 12:15:30 +0200 Subject: [PATCH 05/13] fix needs --- .github/workflows/ci.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 529e2101..844e0814 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -238,7 +238,14 @@ jobs: checks-pass: # Always run this job! if: always() - needs: [build, examples, benchmark] + needs: + [ + build, + examples, + benchmark-btreemap, + benchmark-memory-manager, + benchmark-vec, + ] runs-on: ubuntu-latest steps: - name: check build result @@ -247,6 +254,12 @@ jobs: - name: check examples result if: ${{ needs.examples.result != 'success' }} run: exit 1 - - name: check benchmark result - if: ${{ needs.benchmark.result != 'success' }} + - name: check benchmark-btreemap result + if: ${{ needs.benchmark-btreemap.result != 'success' }} + run: exit 1 + - name: check benchmark-memory-manager result + if: ${{ needs.benchmark-memory-manager.result != 'success' }} + run: exit 1 + - name: check benchmark-vec result + if: ${{ needs.benchmark-vec.result != 'success' }} run: exit 1 From 591439d66d3c4c03a9afa31774be15158cbe7232 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Fri, 23 May 2025 12:29:58 +0200 Subject: [PATCH 06/13] fix script --- scripts/ci_run_benchmark.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/ci_run_benchmark.sh b/scripts/ci_run_benchmark.sh index 6bd7b442..16d7d9d4 100644 --- a/scripts/ci_run_benchmark.sh +++ b/scripts/ci_run_benchmark.sh @@ -56,6 +56,9 @@ time=$(date -u +"%Y-%m-%d %H:%M:%S UTC") # Print output with correct formatting echo "# \`canbench\` 🏋 (dir: $CANISTER_PATH) $commit_hash $time" > "$COMMENT_MESSAGE_PATH" +# Set default to avoid 'unbound variable' error +CSV_RESULTS_FILE_MSG="" + # Check for performance changes relative to the main branch. if [ -f "$MAIN_BRANCH_RESULTS_FILE" ]; then # Replace the current results with the main branch results. From b33b343d7c5dbcda1dd172a59a872cfea3dc35aa Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Fri, 23 May 2025 12:31:12 +0200 Subject: [PATCH 07/13] . --- .github/workflows/ci.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 844e0814..f4e77cd1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,21 +79,6 @@ jobs: run: | bash examples/test.sh - upload-pr-number: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Save PR number - run: | - echo ${{ github.event.number }} > /tmp/pr_number - - - uses: actions/upload-artifact@v4 - with: - name: pr_number - path: /tmp/pr_number - benchmark-btreemap: runs-on: ubuntu-latest needs: build @@ -235,6 +220,21 @@ jobs: run: | bash ./scripts/ci_post_run_benchmark.sh + upload-pr-number: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Save PR number + run: | + echo ${{ github.event.number }} > /tmp/pr_number + + - uses: actions/upload-artifact@v4 + with: + name: pr_number + path: /tmp/pr_number + checks-pass: # Always run this job! if: always() From b09a7ac2fb9e20ec3045de7dac2d6d0361f504bd Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Fri, 23 May 2025 12:32:42 +0200 Subject: [PATCH 08/13] . --- benchmarks/btreemap/canbench.yml | 2 +- benchmarks/memory_manager/canbench.yml | 2 +- benchmarks/vec/canbench.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmarks/btreemap/canbench.yml b/benchmarks/btreemap/canbench.yml index 906dc15c..48d8c284 100644 --- a/benchmarks/btreemap/canbench.yml +++ b/benchmarks/btreemap/canbench.yml @@ -1,3 +1,3 @@ build_cmd: cargo build -p benchmarks --release --target wasm32-unknown-unknown -wasm_path: ./../../target/wasm32-unknown-unknown/release/btreemap.wasm +wasm_path: ../../target/wasm32-unknown-unknown/release/btreemap.wasm diff --git a/benchmarks/memory_manager/canbench.yml b/benchmarks/memory_manager/canbench.yml index 81b4875b..b48a9deb 100644 --- a/benchmarks/memory_manager/canbench.yml +++ b/benchmarks/memory_manager/canbench.yml @@ -1,3 +1,3 @@ build_cmd: cargo build -p benchmarks --release --target wasm32-unknown-unknown -wasm_path: ./../../target/wasm32-unknown-unknown/release/memory_manager.wasm +wasm_path: ../../target/wasm32-unknown-unknown/release/memory_manager.wasm diff --git a/benchmarks/vec/canbench.yml b/benchmarks/vec/canbench.yml index a7a317d8..405af8a9 100644 --- a/benchmarks/vec/canbench.yml +++ b/benchmarks/vec/canbench.yml @@ -1,3 +1,3 @@ build_cmd: cargo build -p benchmarks --release --target wasm32-unknown-unknown -wasm_path: ./../../target/wasm32-unknown-unknown/release/vec.wasm +wasm_path: ../../target/wasm32-unknown-unknown/release/vec.wasm From 6ec583225266cfc2558d9fffb8c8445c0b223c73 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Fri, 23 May 2025 12:36:19 +0200 Subject: [PATCH 09/13] benchmark strategy --- .github/workflows/ci.yml | 143 ++++++++------------------------------- 1 file changed, 27 insertions(+), 116 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4e77cd1..075f8149 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,105 +79,26 @@ jobs: run: | bash examples/test.sh - benchmark-btreemap: + benchmark: runs-on: ubuntu-latest needs: build - env: - PROJECT_DIR: ./benchmarks/btreemap - steps: - - name: Checkout current PR - uses: actions/checkout@v4 - - - name: Checkout main branch - uses: actions/checkout@v4 - with: - ref: main - path: _canbench_main_branch - - - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-1 - - - name: Install Rust - run: | - rustup update ${{ matrix.rust }} --no-self-update - rustup default ${{ matrix.rust }} - rustup target add wasm32-unknown-unknown - - - name: Benchmark - run: | - bash ./scripts/ci_run_benchmark.sh $PROJECT_DIR ${{ github.job }} - - - uses: actions/upload-artifact@v4 - with: - name: canbench_result_${{github.job}} - path: /tmp/canbench_result_${{ github.job }} - - - uses: actions/upload-artifact@v4 - with: - name: canbench_results_${{github.job}}_csv - path: /tmp/canbench_results_${{ github.job }}.csv - - - name: Pass or fail - run: | - bash ./scripts/ci_post_run_benchmark.sh + strategy: + matrix: + name: + - btreemap + - memory-manager + - vec + include: + - name: btreemap + project_dir: ./benchmarks/btreemap + - name: memory-manager + project_dir: ./benchmarks/memory_manager + - name: vec + project_dir: ./benchmarks/vec - benchmark-memory-manager: - runs-on: ubuntu-latest - needs: build env: - PROJECT_DIR: ./benchmarks/memory_manager - steps: - - name: Checkout current PR - uses: actions/checkout@v4 - - - name: Checkout main branch - uses: actions/checkout@v4 - with: - ref: main - path: _canbench_main_branch - - - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-1 - - - name: Install Rust - run: | - rustup update ${{ matrix.rust }} --no-self-update - rustup default ${{ matrix.rust }} - rustup target add wasm32-unknown-unknown - - - name: Benchmark - run: | - bash ./scripts/ci_run_benchmark.sh $PROJECT_DIR ${{ github.job }} + PROJECT_DIR: ${{ matrix.project_dir }} - - uses: actions/upload-artifact@v4 - with: - name: canbench_result_${{github.job}} - path: /tmp/canbench_result_${{ github.job }} - - - uses: actions/upload-artifact@v4 - with: - name: canbench_results_${{github.job}}_csv - path: /tmp/canbench_results_${{ github.job }}.csv - - - name: Pass or fail - run: | - bash ./scripts/ci_post_run_benchmark.sh - - benchmark-vec: - runs-on: ubuntu-latest - needs: build - env: - PROJECT_DIR: ./benchmarks/vec steps: - name: Checkout current PR uses: actions/checkout@v4 @@ -198,23 +119,23 @@ jobs: - name: Install Rust run: | - rustup update ${{ matrix.rust }} --no-self-update - rustup default ${{ matrix.rust }} + rustup update ${{ matrix.rust || 'stable' }} --no-self-update + rustup default ${{ matrix.rust || 'stable' }} rustup target add wasm32-unknown-unknown - name: Benchmark run: | - bash ./scripts/ci_run_benchmark.sh $PROJECT_DIR ${{ github.job }} + bash ./scripts/ci_run_benchmark.sh $PROJECT_DIR ${{ matrix.name }} - uses: actions/upload-artifact@v4 with: - name: canbench_result_${{github.job}} - path: /tmp/canbench_result_${{ github.job }} + name: canbench_result_${{ matrix.name }} + path: /tmp/canbench_result_${{ matrix.name }} - uses: actions/upload-artifact@v4 with: - name: canbench_results_${{github.job}}_csv - path: /tmp/canbench_results_${{ github.job }}.csv + name: canbench_results_${{ matrix.name }}_csv + path: /tmp/canbench_results_${{ matrix.name }}.csv - name: Pass or fail run: | @@ -239,13 +160,9 @@ jobs: # Always run this job! if: always() needs: - [ - build, - examples, - benchmark-btreemap, - benchmark-memory-manager, - benchmark-vec, - ] + - build + - examples + - benchmark runs-on: ubuntu-latest steps: - name: check build result @@ -254,12 +171,6 @@ jobs: - name: check examples result if: ${{ needs.examples.result != 'success' }} run: exit 1 - - name: check benchmark-btreemap result - if: ${{ needs.benchmark-btreemap.result != 'success' }} - run: exit 1 - - name: check benchmark-memory-manager result - if: ${{ needs.benchmark-memory-manager.result != 'success' }} - run: exit 1 - - name: check benchmark-vec result - if: ${{ needs.benchmark-vec.result != 'success' }} + - name: check benchmark result + if: ${{ needs.benchmark.result != 'success' }} run: exit 1 From 6ebb39a032897fe3d626df41ca12f3f252eabf69 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Fri, 23 May 2025 12:48:13 +0200 Subject: [PATCH 10/13] . --- scripts/ci_run_benchmark.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci_run_benchmark.sh b/scripts/ci_run_benchmark.sh index 16d7d9d4..23fed6de 100644 --- a/scripts/ci_run_benchmark.sh +++ b/scripts/ci_run_benchmark.sh @@ -34,7 +34,7 @@ fi # Check if the canbench results file is up to date. pushd "$CANISTER_PATH" -canbench --less-verbose > $CANBENCH_OUTPUT +canbench --less-verbose --hide-results --show-summary > $CANBENCH_OUTPUT if grep -q "(regress\|(improved by \|(new)" "$CANBENCH_OUTPUT"; then UPDATED_MSG="**❌ \`$CANBENCH_RESULTS_FILE\` is not up to date** If the performance change is expected, run \`canbench --persist [--csv]\` to update the benchmark results." From 4683de7551bac2541522aeb85a436fd3dfc90165 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Fri, 23 May 2025 12:49:43 +0200 Subject: [PATCH 11/13] ci: fix output without main --- scripts/ci_run_benchmark.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/ci_run_benchmark.sh b/scripts/ci_run_benchmark.sh index 23fed6de..e83621d9 100644 --- a/scripts/ci_run_benchmark.sh +++ b/scripts/ci_run_benchmark.sh @@ -34,7 +34,7 @@ fi # Check if the canbench results file is up to date. pushd "$CANISTER_PATH" -canbench --less-verbose --hide-results --show-summary > $CANBENCH_OUTPUT +canbench --less-verbose --hide-results --show-summary --csv > $CANBENCH_OUTPUT if grep -q "(regress\|(improved by \|(new)" "$CANBENCH_OUTPUT"; then UPDATED_MSG="**❌ \`$CANBENCH_RESULTS_FILE\` is not up to date** If the performance change is expected, run \`canbench --persist [--csv]\` to update the benchmark results." @@ -56,9 +56,6 @@ time=$(date -u +"%Y-%m-%d %H:%M:%S UTC") # Print output with correct formatting echo "# \`canbench\` 🏋 (dir: $CANISTER_PATH) $commit_hash $time" > "$COMMENT_MESSAGE_PATH" -# Set default to avoid 'unbound variable' error -CSV_RESULTS_FILE_MSG="" - # Check for performance changes relative to the main branch. if [ -f "$MAIN_BRANCH_RESULTS_FILE" ]; then # Replace the current results with the main branch results. @@ -69,10 +66,10 @@ if [ -f "$MAIN_BRANCH_RESULTS_FILE" ]; then canbench --less-verbose --hide-results --show-summary --csv > "$CANBENCH_OUTPUT" cp "./canbench_results.csv" "$CANBENCH_RESULTS_CSV_FILE" popd - - CSV_RESULTS_FILE_MSG="📦 \`canbench_results_$CANBENCH_JOB_NAME.csv\` available in [artifacts](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})" fi +CSV_RESULTS_FILE_MSG="📦 \`canbench_results_$CANBENCH_JOB_NAME.csv\` available in [artifacts](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})" + # Append the update status and benchmark output to the comment. { echo "$UPDATED_MSG" From ae25a348f653465607db6b9eb051ecdab266e472 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Fri, 23 May 2025 13:02:39 +0200 Subject: [PATCH 12/13] fix uploading csv --- scripts/ci_run_benchmark.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ci_run_benchmark.sh b/scripts/ci_run_benchmark.sh index e83621d9..e4680a9c 100644 --- a/scripts/ci_run_benchmark.sh +++ b/scripts/ci_run_benchmark.sh @@ -35,6 +35,7 @@ fi # Check if the canbench results file is up to date. pushd "$CANISTER_PATH" canbench --less-verbose --hide-results --show-summary --csv > $CANBENCH_OUTPUT +cp "./canbench_results.csv" "$CANBENCH_RESULTS_CSV_FILE" if grep -q "(regress\|(improved by \|(new)" "$CANBENCH_OUTPUT"; then UPDATED_MSG="**❌ \`$CANBENCH_RESULTS_FILE\` is not up to date** If the performance change is expected, run \`canbench --persist [--csv]\` to update the benchmark results." From ac6c8850c96e6c8cc9d0df6045e078df24c6a68c Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Fri, 23 May 2025 13:31:03 +0200 Subject: [PATCH 13/13] . --- scripts/ci_run_benchmark.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci_run_benchmark.sh b/scripts/ci_run_benchmark.sh index e4680a9c..e8a1bd4a 100644 --- a/scripts/ci_run_benchmark.sh +++ b/scripts/ci_run_benchmark.sh @@ -34,7 +34,7 @@ fi # Check if the canbench results file is up to date. pushd "$CANISTER_PATH" -canbench --less-verbose --hide-results --show-summary --csv > $CANBENCH_OUTPUT +canbench --less-verbose --hide-results --show-summary --csv > "$CANBENCH_OUTPUT" cp "./canbench_results.csv" "$CANBENCH_RESULTS_CSV_FILE" if grep -q "(regress\|(improved by \|(new)" "$CANBENCH_OUTPUT"; then UPDATED_MSG="**❌ \`$CANBENCH_RESULTS_FILE\` is not up to date**