Put nightly benches in separate crate so they don't have to be commented out.

This commit is contained in:
Anton-4 2021-06-08 20:15:13 +02:00
parent 89edd75aeb
commit afa6e58b54
6 changed files with 298 additions and 64 deletions

245
Cargo.lock generated
View File

@ -47,7 +47,7 @@ checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98"
dependencies = [
"getrandom 0.2.3",
"once_cell",
"version_check",
"version_check 0.9.3",
]
[[package]]
@ -137,7 +137,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
"hermit-abi",
"libc",
"libc 0.2.95",
"winapi 0.3.9",
]
@ -162,7 +162,7 @@ dependencies = [
"addr2line",
"cc",
"cfg-if 1.0.0",
"libc",
"libc 0.2.95",
"miniz_oxide",
"object",
"rustc-demangle",
@ -183,6 +183,12 @@ version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
[[package]]
name = "bit_field"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcb6dd1c2376d2e096796e234a70e17e94cc2d5d54ff8ce42b28cef1d0d359a4"
[[package]]
name = "bitflags"
version = "1.2.1"
@ -434,7 +440,7 @@ dependencies = [
"core-foundation 0.9.1",
"core-graphics 0.22.2",
"foreign-types",
"libc",
"libc 0.2.95",
"objc",
]
@ -449,7 +455,7 @@ dependencies = [
"core-foundation 0.9.1",
"core-graphics-types",
"foreign-types",
"libc",
"libc 0.2.95",
"objc",
]
@ -531,7 +537,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171"
dependencies = [
"core-foundation-sys 0.7.0",
"libc",
"libc 0.2.95",
]
[[package]]
@ -541,7 +547,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62"
dependencies = [
"core-foundation-sys 0.8.2",
"libc",
"libc 0.2.95",
]
[[package]]
@ -565,7 +571,7 @@ dependencies = [
"bitflags",
"core-foundation 0.7.0",
"foreign-types",
"libc",
"libc 0.2.95",
]
[[package]]
@ -578,7 +584,7 @@ dependencies = [
"core-foundation 0.9.1",
"core-graphics-types",
"foreign-types",
"libc",
"libc 0.2.95",
]
[[package]]
@ -590,7 +596,7 @@ dependencies = [
"bitflags",
"core-foundation 0.9.1",
"foreign-types",
"libc",
"libc 0.2.95",
]
[[package]]
@ -602,7 +608,7 @@ dependencies = [
"cfg-if 0.1.10",
"core-foundation-sys 0.7.0",
"core-graphics 0.19.2",
"libc",
"libc 0.2.95",
"objc",
]
@ -612,7 +618,7 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8"
dependencies = [
"libc",
"libc 0.2.95",
]
[[package]]
@ -649,6 +655,15 @@ dependencies = [
"walkdir",
]
[[package]]
name = "criterion-perf-events"
version = "0.1.3"
source = "git+https://github.com/Anton-4/criterion-perf-events#e30bbb54fb00881515a9ae78b00a2a01ec5c376f"
dependencies = [
"criterion",
"perfcnt",
]
[[package]]
name = "criterion-plot"
version = "0.4.3"
@ -914,7 +929,7 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
dependencies = [
"libc",
"libc 0.2.95",
"redox_users",
"winapi 0.3.9",
]
@ -1022,7 +1037,7 @@ checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0"
dependencies = [
"cfg-if 1.0.0",
"crc32fast",
"libc",
"libc 0.2.95",
"miniz_oxide",
]
@ -1188,7 +1203,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817"
dependencies = [
"typenum",
"version_check",
"version_check 0.9.3",
]
[[package]]
@ -1198,7 +1213,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
dependencies = [
"cfg-if 1.0.0",
"libc",
"libc 0.2.95",
"wasi 0.9.0+wasi-snapshot-preview1",
]
@ -1209,7 +1224,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
dependencies = [
"cfg-if 1.0.0",
"libc",
"libc 0.2.95",
"wasi 0.10.2+wasi-snapshot-preview1",
]
@ -1495,7 +1510,7 @@ version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c"
dependencies = [
"libc",
"libc 0.2.95",
]
[[package]]
@ -1521,7 +1536,7 @@ dependencies = [
"rand_xoshiro",
"sized-chunks 0.5.3",
"typenum",
"version_check",
"version_check 0.9.3",
]
[[package]]
@ -1535,7 +1550,7 @@ dependencies = [
"rand_xoshiro",
"sized-chunks 0.6.5",
"typenum",
"version_check",
"version_check 0.9.3",
]
[[package]]
@ -1549,7 +1564,7 @@ dependencies = [
"rand_xoshiro",
"sized-chunks 0.5.3",
"typenum",
"version_check",
"version_check 0.9.3",
]
[[package]]
@ -1563,7 +1578,7 @@ dependencies = [
"rand_xoshiro",
"sized-chunks 0.6.5",
"typenum",
"version_check",
"version_check 0.9.3",
]
[[package]]
@ -1622,7 +1637,7 @@ source = "git+https://github.com/rtfeldman/inkwell?tag=llvm10-0.release5#f0a32d3
dependencies = [
"either",
"inkwell_internals",
"libc",
"libc 0.2.95",
"llvm-sys",
"once_cell",
"parking_lot",
@ -1666,7 +1681,7 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e"
dependencies = [
"libc",
"libc 0.2.95",
]
[[package]]
@ -1705,7 +1720,7 @@ version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "972f5ae5d1cb9c6ae417789196c803205313edde988685da5e3aae0827b9e7fd"
dependencies = [
"libc",
"libc 0.2.95",
]
[[package]]
@ -1733,7 +1748,7 @@ version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3"
dependencies = [
"libc",
"libc 0.2.95",
"libloading 0.7.0",
]
@ -1755,6 +1770,12 @@ version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "libc"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e32a70cf75e5846d53a673923498228bbec6a8624708a9ea5645f075d6276122"
[[package]]
name = "libc"
version = "0.2.95"
@ -1795,7 +1816,7 @@ checksum = "15d9c00ce56221b2150e2d4d51887ff139fce5a0e50346c744861d1e66d2f7c4"
dependencies = [
"cc",
"lazy_static",
"libc",
"libc 0.2.95",
"regex",
"semver 0.9.0",
]
@ -1824,7 +1845,7 @@ version = "0.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"
dependencies = [
"libc",
"libc 0.2.95",
]
[[package]]
@ -1851,7 +1872,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a"
dependencies = [
"libc",
"libc 0.2.95",
]
[[package]]
@ -1907,7 +1928,7 @@ dependencies = [
"fuchsia-zircon-sys",
"iovec",
"kernel32-sys",
"libc",
"libc 0.2.95",
"log",
"miow",
"net2",
@ -1939,6 +1960,16 @@ dependencies = [
"ws2_32-sys",
]
[[package]]
name = "mmap"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bc85448a6006dd2ba26a385a564a8a0f1f2c7e78c70f1a70b2e0f4af286b823"
dependencies = [
"libc 0.1.12",
"tempdir",
]
[[package]]
name = "morphic_lib"
version = "0.1.0"
@ -1984,7 +2015,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdf399b8b7a39c6fb153c4ec32c72fd5fe789df24a647f229c239aa7adb15241"
dependencies = [
"lazy_static",
"libc",
"libc 0.2.95",
"log",
"ndk",
"ndk-macro",
@ -2017,10 +2048,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae"
dependencies = [
"cfg-if 0.1.10",
"libc",
"libc 0.2.95",
"winapi 0.3.9",
]
[[package]]
name = "nightly_benches"
version = "0.1.0"
dependencies = [
"cli_utils",
"criterion",
"criterion-perf-events",
"perfcnt",
]
[[package]]
name = "nix"
version = "0.17.0"
@ -2030,7 +2071,7 @@ dependencies = [
"bitflags",
"cc",
"cfg-if 0.1.10",
"libc",
"libc 0.2.95",
"void",
]
@ -2043,7 +2084,7 @@ dependencies = [
"bitflags",
"cc",
"cfg-if 0.1.10",
"libc",
"libc 0.2.95",
]
[[package]]
@ -2055,7 +2096,17 @@ dependencies = [
"bitflags",
"cc",
"cfg-if 1.0.0",
"libc",
"libc 0.2.95",
]
[[package]]
name = "nom"
version = "4.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6"
dependencies = [
"memchr",
"version_check 0.1.5",
]
[[package]]
@ -2065,7 +2116,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2"
dependencies = [
"memchr",
"version_check",
"version_check 0.9.3",
]
[[package]]
@ -2090,7 +2141,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
dependencies = [
"hermit-abi",
"libc",
"libc 0.2.95",
]
[[package]]
@ -2232,7 +2283,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eebde548fbbf1ea81a99b128872779c437752fb99f217c45245e1a61dcd9edcd"
dependencies = [
"libc",
"libc 0.2.95",
"winapi 0.3.9",
]
@ -2280,7 +2331,7 @@ dependencies = [
"backtrace",
"cfg-if 1.0.0",
"instant",
"libc",
"libc 0.2.95",
"petgraph",
"redox_syscall 0.2.8",
"smallvec",
@ -2294,6 +2345,21 @@ version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
[[package]]
name = "perfcnt"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88a4decf2d171c232d741ca37d590cd50d35314b7d348198e7e474e0bf34c8b4"
dependencies = [
"bitflags",
"byteorder",
"libc 0.2.95",
"mmap",
"nom 4.2.3",
"phf",
"x86",
]
[[package]]
name = "pest"
version = "2.1.3"
@ -2483,7 +2549,7 @@ dependencies = [
"proc-macro2 1.0.27",
"quote 1.0.9",
"syn 1.0.72",
"version_check",
"version_check 0.9.3",
]
[[package]]
@ -2496,7 +2562,7 @@ dependencies = [
"quote 1.0.9",
"syn 1.0.72",
"syn-mid",
"version_check",
"version_check 0.9.3",
]
[[package]]
@ -2609,6 +2675,19 @@ dependencies = [
"proc-macro2 1.0.27",
]
[[package]]
name = "rand"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293"
dependencies = [
"fuchsia-cprng",
"libc 0.2.95",
"rand_core 0.3.1",
"rdrand",
"winapi 0.3.9",
]
[[package]]
name = "rand"
version = "0.6.5"
@ -2616,7 +2695,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"
dependencies = [
"autocfg 0.1.7",
"libc",
"libc 0.2.95",
"rand_chacha 0.1.1",
"rand_core 0.4.2",
"rand_hc 0.1.0",
@ -2635,7 +2714,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
dependencies = [
"getrandom 0.1.16",
"libc",
"libc 0.2.95",
"rand_chacha 0.2.2",
"rand_core 0.5.1",
"rand_hc 0.2.0",
@ -2648,7 +2727,7 @@ version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
dependencies = [
"libc",
"libc 0.2.95",
"rand_chacha 0.3.0",
"rand_core 0.6.2",
"rand_hc 0.3.0",
@ -2759,7 +2838,7 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b"
dependencies = [
"libc",
"libc 0.2.95",
"rand_core 0.4.2",
"winapi 0.3.9",
]
@ -2772,7 +2851,7 @@ checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071"
dependencies = [
"cloudabi",
"fuchsia-cprng",
"libc",
"libc 0.2.95",
"rand_core 0.4.2",
"rdrand",
"winapi 0.3.9",
@ -2821,13 +2900,22 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63e935c45e09cc6dcf00d2f0b2d630a58f4095320223d47fc68918722f0538b6"
[[package]]
name = "raw-cpuid"
version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c27cb5785b85bd05d4eb171556c9a1a514552e26123aeae6bb7d811353148026"
dependencies = [
"bitflags",
]
[[package]]
name = "raw-window-handle"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211"
dependencies = [
"libc",
"libc 0.2.95",
]
[[package]]
@ -3011,7 +3099,7 @@ dependencies = [
"indoc 0.3.6",
"inkwell 0.1.0",
"inlinable_string",
"libc",
"libc 0.2.95",
"libloading 0.6.7",
"maplit",
"pretty_assertions 0.5.1",
@ -3106,7 +3194,7 @@ dependencies = [
"im-rc 15.0.0",
"indoc 1.0.3",
"inlinable_string",
"libc",
"libc 0.2.95",
"log",
"maplit",
"nonempty",
@ -3168,7 +3256,7 @@ dependencies = [
"indoc 0.3.6",
"inlinable_string",
"itertools 0.9.0",
"libc",
"libc 0.2.95",
"libloading 0.6.7",
"maplit",
"object",
@ -3207,7 +3295,7 @@ dependencies = [
"indoc 0.3.6",
"inkwell 0.1.0",
"inlinable_string",
"libc",
"libc 0.2.95",
"maplit",
"pretty_assertions 0.5.1",
"quickcheck 0.8.5",
@ -3397,7 +3485,7 @@ dependencies = [
name = "roc_std"
version = "0.1.0"
dependencies = [
"libc",
"libc 0.2.95",
]
[[package]]
@ -3477,7 +3565,7 @@ source = "git+https://github.com/rtfeldman/rustyline?tag=prompt-fix#a6b8a20d2bf5
dependencies = [
"cfg-if 0.1.10",
"dirs-next",
"libc",
"libc 0.2.95",
"log",
"memchr",
"nix 0.17.0",
@ -3866,6 +3954,16 @@ version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab0e7238dcc7b40a7be719a25365910f6807bd864f4cce6b2e6b873658e2b19d"
[[package]]
name = "tempdir"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8"
dependencies = [
"rand 0.4.6",
"remove_dir_all",
]
[[package]]
name = "tempfile"
version = "3.2.0"
@ -3873,7 +3971,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22"
dependencies = [
"cfg-if 1.0.0",
"libc",
"libc 0.2.95",
"rand 0.8.3",
"redox_syscall 0.2.8",
"remove_dir_all",
@ -3900,7 +3998,7 @@ dependencies = [
"indoc 0.3.6",
"inkwell 0.1.0",
"inlinable_string",
"libc",
"libc 0.2.95",
"libloading 0.6.7",
"maplit",
"quickcheck 0.8.5",
@ -3936,7 +4034,7 @@ dependencies = [
"im-rc 14.3.0",
"indoc 0.3.6",
"inlinable_string",
"libc",
"libc 0.2.95",
"libloading 0.6.7",
"pretty_assertions 0.5.1",
"quickcheck 0.8.5",
@ -4005,7 +4103,7 @@ version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1"
dependencies = [
"libc",
"libc 0.2.95",
"redox_syscall 0.1.57",
"winapi 0.3.9",
]
@ -4096,7 +4194,7 @@ version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
dependencies = [
"version_check",
"version_check 0.9.3",
]
[[package]]
@ -4173,6 +4271,12 @@ dependencies = [
"typed-arena",
]
[[package]]
name = "version_check"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
[[package]]
name = "version_check"
version = "0.9.3"
@ -4291,7 +4395,7 @@ checksum = "06ca44d86554b85cf449f1557edc6cc7da935cc748c8e4bf1c507cbd43bae02c"
dependencies = [
"bitflags",
"downcast-rs",
"libc",
"libc 0.2.95",
"nix 0.20.0",
"scoped-tls",
"wayland-commons",
@ -4494,7 +4598,7 @@ dependencies = [
"dispatch",
"instant",
"lazy_static",
"libc",
"libc 0.2.95",
"log",
"mio",
"mio-extras",
@ -4555,18 +4659,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bf981e3a5b3301209754218f962052d4d9ee97e478f4d26d4a6eced34c1fef8"
dependencies = [
"lazy_static",
"libc",
"libc 0.2.95",
"maybe-uninit",
"pkg-config",
]
[[package]]
name = "x86"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4fd9298cd1b1f88546fc0a5e8faa3354013cd010589299c624fde436aad76cc"
dependencies = [
"bit_field",
"bitflags",
"csv",
"phf",
"phf_codegen",
"raw-cpuid",
"serde_json",
]
[[package]]
name = "xcb"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62056f63138b39116f82a540c983cc11f1c90cd70b3d492a70c25eaa50bd22a6"
dependencies = [
"libc",
"libc 0.2.95",
"log",
]
@ -4576,7 +4695,7 @@ version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a9a231574ae78801646617cefd13bfe94be907c0e4fa979cfd8b770aa3c5d08"
dependencies = [
"nom",
"nom 6.1.2",
]
[[package]]

View File

@ -30,7 +30,8 @@ members = [
"cli",
"cli/cli_utils",
"roc_std",
"docs"
"docs",
"nightly_benches",
]
# Needed to be able to run `cargo run -p roc_cli --no-default-features` -
# see www/build.sh for more.

View File

@ -0,0 +1,16 @@
[package]
name = "nightly_benches"
version = "0.1.0"
edition = "2018"
[dependencies]
[dev-dependencies]
criterion = { git = "https://github.com/Anton-4/criterion.rs"}
cli_utils = { path = "../cli/cli_utils" }
criterion-perf-events ={ git = "https://github.com/Anton-4/criterion-perf-events" }
perfcnt = "0.7.1"
[[bench]]
name = "events_bench"
harness = false

View File

@ -0,0 +1,94 @@
// Keep this benchmark. It's commented because it requires nightly rust.
use cli_utils::bench_utils::{
bench_cfold, bench_deriv, bench_nqueens, bench_rbtree_ck, bench_rbtree_delete,
};
use criterion_perf_events::Perf;
use perfcnt::linux::HardwareEventType as Hardware;
use perfcnt::linux::PerfCounterBuilderLinux as Builder;
use criterion::{criterion_group, criterion_main, BenchmarkGroup, Criterion, SamplingMode};
fn bench_group(c: &mut Criterion<Perf>, hw_event_str: &str) {
let mut group = c.benchmark_group(format!("bench-group_no-opt_{}", hw_event_str));
// calculate statistics based on a fixed(flat) 100 runs
group.sampling_mode(SamplingMode::Flat);
let bench_funcs: Vec<fn(Option<&mut BenchmarkGroup<Perf>>) -> ()> = vec![
bench_nqueens,
bench_cfold,
bench_deriv,
bench_rbtree_ck,
bench_rbtree_delete,
// TODO quicksort
];
for bench_func in bench_funcs.iter() {
bench_func(Some(&mut group))
}
group.finish();
}
use perfcnt::linux::HardwareEventType;
fn init_criterion(event: HardwareEventType) -> Criterion<Perf> {
Criterion::default().with_measurement(Perf::new(Builder::from_hardware_event(event)))
}
fn bench_instructions(c: &mut Criterion<Perf>) {
bench_group(c, "instructions")
}
criterion_group!(
name = benches_instructions;
config = init_criterion(Hardware::Instructions);
targets = bench_instructions
);
fn bench_cache_refs(c: &mut Criterion<Perf>) {
bench_group(c, "cache_refs")
}
criterion_group!(
name = benches_cache_refs;
config = init_criterion(Hardware::CacheReferences);
targets = bench_cache_refs
);
fn bench_cache_misses(c: &mut Criterion<Perf>) {
bench_group(c, "cache_misses")
}
criterion_group!(
name = benches_cache_misses;
config = init_criterion(Hardware::CacheMisses);
targets = bench_cache_misses
);
fn bench_branch_instructions(c: &mut Criterion<Perf>) {
bench_group(c, "branch_instructions")
}
criterion_group!(
name = benches_branch_instructions;
config = init_criterion(Hardware::BranchInstructions);
targets = bench_branch_instructions
);
fn bench_branch_misses(c: &mut Criterion<Perf>) {
bench_group(c, "branch_misses")
}
criterion_group!(
name = benches_branch_misses;
config = init_criterion(Hardware::BranchMisses);
targets = bench_branch_misses
);
criterion_main!(
benches_instructions,
/*benches_cache_refs,
benches_cache_misses,
benches_branch_instructions,
benches_branch_misses*/
);

View File

@ -0,0 +1 @@
nightly

View File

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}