已开启
添加两个标准库bench simd实现及测试数据对比 #54
Sparrow Li (LiYuan)创建于 6月8日
添加两个标准库bench simd实现及测试数据对比 #54
已开启
共 55 个文件变更+7357-0
| @@ -0,0 +1,455 @@ | |||
| 1 | +# This file is automatically @generated by Cargo. | ||
| 2 | +# It is not intended for manual editing. | ||
| 3 | +version = 4 | ||
| 4 | + | ||
| 5 | +[[package]] | ||
| 6 | +name = "aho-corasick" | ||
| 7 | +version = "1.1.4" | ||
| 8 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 9 | +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" | ||
| 10 | +dependencies = [ | ||
| 11 | + "memchr", | ||
| 12 | +] | ||
| 13 | + | ||
| 14 | +[[package]] | ||
| 15 | +name = "anstream" | ||
| 16 | +version = "1.0.0" | ||
| 17 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 18 | +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" | ||
| 19 | +dependencies = [ | ||
| 20 | + "anstyle", | ||
| 21 | + "anstyle-parse", | ||
| 22 | + "anstyle-query", | ||
| 23 | + "anstyle-wincon", | ||
| 24 | + "colorchoice", | ||
| 25 | + "is_terminal_polyfill", | ||
| 26 | + "utf8parse", | ||
| 27 | +] | ||
| 28 | + | ||
| 29 | +[[package]] | ||
| 30 | +name = "anstyle" | ||
| 31 | +version = "1.0.14" | ||
| 32 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 33 | +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" | ||
| 34 | + | ||
| 35 | +[[package]] | ||
| 36 | +name = "anstyle-parse" | ||
| 37 | +version = "1.0.0" | ||
| 38 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 39 | +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" | ||
| 40 | +dependencies = [ | ||
| 41 | + "utf8parse", | ||
| 42 | +] | ||
| 43 | + | ||
| 44 | +[[package]] | ||
| 45 | +name = "anstyle-query" | ||
| 46 | +version = "1.1.5" | ||
| 47 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 48 | +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" | ||
| 49 | +dependencies = [ | ||
| 50 | + "windows-sys", | ||
| 51 | +] | ||
| 52 | + | ||
| 53 | +[[package]] | ||
| 54 | +name = "anstyle-wincon" | ||
| 55 | +version = "3.0.11" | ||
| 56 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 57 | +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" | ||
| 58 | +dependencies = [ | ||
| 59 | + "anstyle", | ||
| 60 | + "once_cell_polyfill", | ||
| 61 | + "windows-sys", | ||
| 62 | +] | ||
| 63 | + | ||
| 64 | +[[package]] | ||
| 65 | +name = "anyhow" | ||
| 66 | +version = "1.0.102" | ||
| 67 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 68 | +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" | ||
| 69 | + | ||
| 70 | +[[package]] | ||
| 71 | +name = "bench-clone-from-10-1000-1000" | ||
| 72 | +version = "0.1.0" | ||
| 73 | +dependencies = [ | ||
| 74 | + "benchlib", | ||
| 75 | + "rustc_version", | ||
| 76 | +] | ||
| 77 | + | ||
| 78 | +[[package]] | ||
| 79 | +name = "benchlib" | ||
| 80 | +version = "0.1.0" | ||
| 81 | +dependencies = [ | ||
| 82 | + "anyhow", | ||
| 83 | + "benchlib-macros", | ||
| 84 | + "clap", | ||
| 85 | + "ctor", | ||
| 86 | + "env_logger", | ||
| 87 | + "libc", | ||
| 88 | + "log", | ||
| 89 | + "perf-event", | ||
| 90 | + "serde", | ||
| 91 | + "serde_json", | ||
| 92 | +] | ||
| 93 | + | ||
| 94 | +[[package]] | ||
| 95 | +name = "benchlib-macros" | ||
| 96 | +version = "0.1.0" | ||
| 97 | +dependencies = [ | ||
| 98 | + "proc-macro2", | ||
| 99 | + "quote", | ||
| 100 | + "syn", | ||
| 101 | +] | ||
| 102 | + | ||
| 103 | +[[package]] | ||
| 104 | +name = "bitflags" | ||
| 105 | +version = "2.13.0" | ||
| 106 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 107 | +checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" | ||
| 108 | + | ||
| 109 | +[[package]] | ||
| 110 | +name = "clap" | ||
| 111 | +version = "4.6.1" | ||
| 112 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 113 | +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" | ||
| 114 | +dependencies = [ | ||
| 115 | + "clap_builder", | ||
| 116 | + "clap_derive", | ||
| 117 | +] | ||
| 118 | + | ||
| 119 | +[[package]] | ||
| 120 | +name = "clap_builder" | ||
| 121 | +version = "4.6.0" | ||
| 122 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 123 | +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" | ||
| 124 | +dependencies = [ | ||
| 125 | + "anstream", | ||
| 126 | + "anstyle", | ||
| 127 | + "clap_lex", | ||
| 128 | + "strsim", | ||
| 129 | +] | ||
| 130 | + | ||
| 131 | +[[package]] | ||
| 132 | +name = "clap_derive" | ||
| 133 | +version = "4.6.1" | ||
| 134 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 135 | +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" | ||
| 136 | +dependencies = [ | ||
| 137 | + "heck", | ||
| 138 | + "proc-macro2", | ||
| 139 | + "quote", | ||
| 140 | + "syn", | ||
| 141 | +] | ||
| 142 | + | ||
| 143 | +[[package]] | ||
| 144 | +name = "clap_lex" | ||
| 145 | +version = "1.1.0" | ||
| 146 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 147 | +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" | ||
| 148 | + | ||
| 149 | +[[package]] | ||
| 150 | +name = "colorchoice" | ||
| 151 | +version = "1.0.5" | ||
| 152 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 153 | +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" | ||
| 154 | + | ||
| 155 | +[[package]] | ||
| 156 | +name = "ctor" | ||
| 157 | +version = "0.6.3" | ||
| 158 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 159 | +checksum = "424e0138278faeb2b401f174ad17e715c829512d74f3d1e81eb43365c2e0590e" | ||
| 160 | +dependencies = [ | ||
| 161 | + "ctor-proc-macro", | ||
| 162 | + "dtor", | ||
| 163 | +] | ||
| 164 | + | ||
| 165 | +[[package]] | ||
| 166 | +name = "ctor-proc-macro" | ||
| 167 | +version = "0.0.7" | ||
| 168 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 169 | +checksum = "52560adf09603e58c9a7ee1fe1dcb95a16927b17c127f0ac02d6e768a0e25bc1" | ||
| 170 | + | ||
| 171 | +[[package]] | ||
| 172 | +name = "dtor" | ||
| 173 | +version = "0.1.1" | ||
| 174 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 175 | +checksum = "404d02eeb088a82cfd873006cb713fe411306c7d182c344905e101fb1167d301" | ||
| 176 | +dependencies = [ | ||
| 177 | + "dtor-proc-macro", | ||
| 178 | +] | ||
| 179 | + | ||
| 180 | +[[package]] | ||
| 181 | +name = "dtor-proc-macro" | ||
| 182 | +version = "0.0.6" | ||
| 183 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 184 | +checksum = "f678cf4a922c215c63e0de95eb1ff08a958a81d47e485cf9da1e27bf6305cfa5" | ||
| 185 | + | ||
| 186 | +[[package]] | ||
| 187 | +name = "env_logger" | ||
| 188 | +version = "0.10.2" | ||
| 189 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 190 | +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" | ||
| 191 | +dependencies = [ | ||
| 192 | + "humantime", | ||
| 193 | + "is-terminal", | ||
| 194 | + "log", | ||
| 195 | + "regex", | ||
| 196 | + "termcolor", | ||
| 197 | +] | ||
| 198 | + | ||
| 199 | +[[package]] | ||
| 200 | +name = "heck" | ||
| 201 | +version = "0.5.0" | ||
| 202 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 203 | +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" | ||
| 204 | + | ||
| 205 | +[[package]] | ||
| 206 | +name = "hermit-abi" | ||
| 207 | +version = "0.5.2" | ||
| 208 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 209 | +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" | ||
| 210 | + | ||
| 211 | +[[package]] | ||
| 212 | +name = "humantime" | ||
| 213 | +version = "2.3.0" | ||
| 214 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 215 | +checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" | ||
| 216 | + | ||
| 217 | +[[package]] | ||
| 218 | +name = "is-terminal" | ||
| 219 | +version = "0.4.17" | ||
| 220 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 221 | +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" | ||
| 222 | +dependencies = [ | ||
| 223 | + "hermit-abi", | ||
| 224 | + "libc", | ||
| 225 | + "windows-sys", | ||
| 226 | +] | ||
| 227 | + | ||
| 228 | +[[package]] | ||
| 229 | +name = "is_terminal_polyfill" | ||
| 230 | +version = "1.70.2" | ||
| 231 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 232 | +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" | ||
| 233 | + | ||
| 234 | +[[package]] | ||
| 235 | +name = "itoa" | ||
| 236 | +version = "1.0.18" | ||
| 237 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 238 | +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" | ||
| 239 | + | ||
| 240 | +[[package]] | ||
| 241 | +name = "libc" | ||
| 242 | +version = "0.2.186" | ||
| 243 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 244 | +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" | ||
| 245 | + | ||
| 246 | +[[package]] | ||
| 247 | +name = "log" | ||
| 248 | +version = "0.4.32" | ||
| 249 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 250 | +checksum = "953f07c43838f8e6f9758cab68bf5bed85465e7587ebe0b823f1bcd81978ad3a" | ||
| 251 | + | ||
| 252 | +[[package]] | ||
| 253 | +name = "memchr" | ||
| 254 | +version = "2.8.1" | ||
| 255 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 256 | +checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8" | ||
| 257 | + | ||
| 258 | +[[package]] | ||
| 259 | +name = "once_cell_polyfill" | ||
| 260 | +version = "1.70.2" | ||
| 261 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 262 | +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" | ||
| 263 | + | ||
| 264 | +[[package]] | ||
| 265 | +name = "perf-event" | ||
| 266 | +version = "0.4.9" | ||
| 267 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 268 | +checksum = "c2529f39584dbaa980f4959510c963ae95f119c127c046012c2834365f694438" | ||
| 269 | +dependencies = [ | ||
| 270 | + "bitflags", | ||
| 271 | + "libc", | ||
| 272 | + "perf-event-open-sys", | ||
| 273 | +] | ||
| 274 | + | ||
| 275 | +[[package]] | ||
| 276 | +name = "perf-event-open-sys" | ||
| 277 | +version = "6.0.0" | ||
| 278 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 279 | +checksum = "a5f8d1487a4ffa23c80a1c355dd27235f9b66fb71ba0f261eb417e4fe8451347" | ||
| 280 | +dependencies = [ | ||
| 281 | + "libc", | ||
| 282 | +] | ||
| 283 | + | ||
| 284 | +[[package]] | ||
| 285 | +name = "proc-macro2" | ||
| 286 | +version = "1.0.106" | ||
| 287 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 288 | +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" | ||
| 289 | +dependencies = [ | ||
| 290 | + "unicode-ident", | ||
| 291 | +] | ||
| 292 | + | ||
| 293 | +[[package]] | ||
| 294 | +name = "quote" | ||
| 295 | +version = "1.0.45" | ||
| 296 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 297 | +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" | ||
| 298 | +dependencies = [ | ||
| 299 | + "proc-macro2", | ||
| 300 | +] | ||
| 301 | + | ||
| 302 | +[[package]] | ||
| 303 | +name = "regex" | ||
| 304 | +version = "1.12.3" | ||
| 305 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 306 | +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" | ||
| 307 | +dependencies = [ | ||
| 308 | + "aho-corasick", | ||
| 309 | + "memchr", | ||
| 310 | + "regex-automata", | ||
| 311 | + "regex-syntax", | ||
| 312 | +] | ||
| 313 | + | ||
| 314 | +[[package]] | ||
| 315 | +name = "regex-automata" | ||
| 316 | +version = "0.4.14" | ||
| 317 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 318 | +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" | ||
| 319 | +dependencies = [ | ||
| 320 | + "aho-corasick", | ||
| 321 | + "memchr", | ||
| 322 | + "regex-syntax", | ||
| 323 | +] | ||
| 324 | + | ||
| 325 | +[[package]] | ||
| 326 | +name = "regex-syntax" | ||
| 327 | +version = "0.8.10" | ||
| 328 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 329 | +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" | ||
| 330 | + | ||
| 331 | +[[package]] | ||
| 332 | +name = "rustc_version" | ||
| 333 | +version = "0.4.1" | ||
| 334 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 335 | +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" | ||
| 336 | +dependencies = [ | ||
| 337 | + "semver", | ||
| 338 | +] | ||
| 339 | + | ||
| 340 | +[[package]] | ||
| 341 | +name = "semver" | ||
| 342 | +version = "1.0.28" | ||
| 343 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 344 | +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" | ||
| 345 | + | ||
| 346 | +[[package]] | ||
| 347 | +name = "serde" | ||
| 348 | +version = "1.0.228" | ||
| 349 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 350 | +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" | ||
| 351 | +dependencies = [ | ||
| 352 | + "serde_core", | ||
| 353 | + "serde_derive", | ||
| 354 | +] | ||
| 355 | + | ||
| 356 | +[[package]] | ||
| 357 | +name = "serde_core" | ||
| 358 | +version = "1.0.228" | ||
| 359 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 360 | +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" | ||
| 361 | +dependencies = [ | ||
| 362 | + "serde_derive", | ||
| 363 | +] | ||
| 364 | + | ||
| 365 | +[[package]] | ||
| 366 | +name = "serde_derive" | ||
| 367 | +version = "1.0.228" | ||
| 368 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 369 | +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" | ||
| 370 | +dependencies = [ | ||
| 371 | + "proc-macro2", | ||
| 372 | + "quote", | ||
| 373 | + "syn", | ||
| 374 | +] | ||
| 375 | + | ||
| 376 | +[[package]] | ||
| 377 | +name = "serde_json" | ||
| 378 | +version = "1.0.150" | ||
| 379 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 380 | +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" | ||
| 381 | +dependencies = [ | ||
| 382 | + "itoa", | ||
| 383 | + "memchr", | ||
| 384 | + "serde", | ||
| 385 | + "serde_core", | ||
| 386 | + "zmij", | ||
| 387 | +] | ||
| 388 | + | ||
| 389 | +[[package]] | ||
| 390 | +name = "strsim" | ||
| 391 | +version = "0.11.1" | ||
| 392 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 393 | +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" | ||
| 394 | + | ||
| 395 | +[[package]] | ||
| 396 | +name = "syn" | ||
| 397 | +version = "2.0.117" | ||
| 398 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 399 | +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" | ||
| 400 | +dependencies = [ | ||
| 401 | + "proc-macro2", | ||
| 402 | + "quote", | ||
| 403 | + "unicode-ident", | ||
| 404 | +] | ||
| 405 | + | ||
| 406 | +[[package]] | ||
| 407 | +name = "termcolor" | ||
| 408 | +version = "1.4.1" | ||
| 409 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 410 | +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" | ||
| 411 | +dependencies = [ | ||
| 412 | + "winapi-util", | ||
| 413 | +] | ||
| 414 | + | ||
| 415 | +[[package]] | ||
| 416 | +name = "unicode-ident" | ||
| 417 | +version = "1.0.24" | ||
| 418 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 419 | +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" | ||
| 420 | + | ||
| 421 | +[[package]] | ||
| 422 | +name = "utf8parse" | ||
| 423 | +version = "0.2.2" | ||
| 424 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 425 | +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" | ||
| 426 | + | ||
| 427 | +[[package]] | ||
| 428 | +name = "winapi-util" | ||
| 429 | +version = "0.1.11" | ||
| 430 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 431 | +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" | ||
| 432 | +dependencies = [ | ||
| 433 | + "windows-sys", | ||
| 434 | +] | ||
| 435 | + | ||
| 436 | +[[package]] | ||
| 437 | +name = "windows-link" | ||
| 438 | +version = "0.2.1" | ||
| 439 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 440 | +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" | ||
| 441 | + | ||
| 442 | +[[package]] | ||
| 443 | +name = "windows-sys" | ||
| 444 | +version = "0.61.2" | ||
| 445 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 446 | +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" | ||
| 447 | +dependencies = [ | ||
| 448 | + "windows-link", | ||
| 449 | +] | ||
| 450 | + | ||
| 451 | +[[package]] | ||
| 452 | +name = "zmij" | ||
| 453 | +version = "1.0.21" | ||
| 454 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 455 | +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" | ||
| @@ -0,0 +1,12 @@ | |||
| 1 | +[package] | ||
| 2 | +name = "bench-clone-from-10-1000-1000" | ||
| 3 | +version = "0.1.0" | ||
| 4 | +edition = "2021" | ||
| 5 | + | ||
| 6 | +[dependencies] | ||
| 7 | +benchlib = { path = "../../benchlib" } | ||
| 8 | + | ||
| 9 | +[build-dependencies] | ||
| 10 | +rustc_version = "0.4" | ||
| 11 | + | ||
| 12 | +[workspace] | ||
| @@ -0,0 +1,6 @@ | |||
| 1 | +fn main() { | ||
| 2 | + println!("cargo:rustc-check-cfg=cfg(nightly)"); | ||
| 3 | + if matches!(rustc_version::version_meta().unwrap().channel, rustc_version::Channel::Nightly | rustc_version::Channel::Dev) { | ||
| 4 | + println!("cargo:rustc-cfg=nightly"); | ||
| 5 | + } | ||
| 6 | +} | ||
| @@ -0,0 +1,32 @@ | |||
| 1 | +[root@localhost rust-bench]# ./target/release/collector bench_runtime_local +nightly --group bench_clone_from_10_1000_1000 | ||
| 2 | +Using database `results.db` | ||
| 3 | +Compiling 1 runtime benchmark group(s) | ||
| 4 | +Compiling `bench_clone_from_10_1000_1000` (1/1) | ||
| 5 | +Executing 3 benchmarks | ||
| 6 | + | ||
| 7 | +Finished bench_clone_from_10_1000_1000/bench_clone_from_10_1000_1000::bench_clone_from_10_1000_1000 (1/3) | ||
| 8 | + [Instructions]: min: 14,384 mean: 14,427 stddev: 35 | ||
| 9 | + [Cycles]: min: 4,402 mean: 4,704 stddev: 220 | ||
| 10 | + [Wall time [ns]]: min: 1,340 mean: 1,376 stddev: 25 | ||
| 11 | + [Branch misses]: min: 4 mean: 5 stddev: 1 | ||
| 12 | + [Cache misses]: min: 77 mean: 82 stddev: 5 | ||
| 13 | +[Cache references]: min: 11,252 mean: 11,282 stddev: 23 | ||
| 14 | + [Memory [kb]]: Not available | ||
| 15 | + | ||
| 16 | +Finished bench_clone_from_10_1000_1000/bench_clone_from_10_1000_1000::bench_clone_from_10_1000_1000_neon (2/3) | ||
| 17 | + [Instructions]: min: 12,738 mean: 12,759 stddev: 21 | ||
| 18 | + [Cycles]: min: 4,771 mean: 4,896 stddev: 143 | ||
| 19 | + [Wall time [ns]]: min: 1,320 mean: 1,356 stddev: 18 | ||
| 20 | + [Branch misses]: min: 5 mean: 9 stddev: 3 | ||
| 21 | + [Cache misses]: min: 80 mean: 82 stddev: 2 | ||
| 22 | +[Cache references]: min: 9,397 mean: 9,446 stddev: 38 | ||
| 23 | + [Memory [kb]]: Not available | ||
| 24 | + | ||
| 25 | +Finished bench_clone_from_10_1000_1000/bench_clone_from_10_1000_1000::bench_clone_from_10_1000_1000_sve (3/3) | ||
| 26 | + [Instructions]: min: 10,881 mean: 10,902 stddev: 21 | ||
| 27 | + [Cycles]: min: 5,306 mean: 5,474 stddev: 155 | ||
| 28 | + [Wall time [ns]]: min: 1,600 mean: 1,636 stddev: 29 | ||
| 29 | + [Branch misses]: min: 4 mean: 6 stddev: 1 | ||
| 30 | + [Cache misses]: min: 81 mean: 87 stddev: 4 | ||
| 31 | +[Cache references]: min: 9,214 mean: 9,275 stddev: 39 | ||
| 32 | + [Memory [kb]]: Not available | ||
| @@ -0,0 +1,156 @@ | |||
| 1 | + | ||
| 2 | + | ||
| 3 | +use benchlib::benchmark::{bench, black_box, Bencher}; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +fn bench_clone_from_10_1000_1000(b: &mut Bencher) { | ||
| 7 | + let dst: Vec<usize> = black_box((0..1000).collect()); | ||
| 8 | + let src: Vec<usize> = black_box((1000..2000).collect()); | ||
| 9 | + | ||
| 10 | + b.iter( | ||
| 11 | + || {}, | ||
| 12 | + |_| { | ||
| 13 | + let mut dst = dst.clone(); | ||
| 14 | + for _ in 0..10 { | ||
| 15 | + dst.clone_from(&src); | ||
| 16 | + dst = black_box(dst); | ||
| 17 | + } | ||
| 18 | + dst | ||
| 19 | + }, | ||
| 20 | + ); | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | + | ||
| 24 | +use std::arch::aarch64::*; | ||
| 25 | + | ||
| 26 | + | ||
| 27 | + | ||
| 28 | +unsafe fn copy_slice_neon(dst_ptr: *mut u64, src_ptr: *const u64, len: usize) { | ||
| 29 | + let mut i = 0usize; | ||
| 30 | + | ||
| 31 | + while i + 16 <= len { | ||
| 32 | + let v0 = vld1q_u64(src_ptr.add(i)); | ||
| 33 | + let v1 = vld1q_u64(src_ptr.add(i + 2)); | ||
| 34 | + let v2 = vld1q_u64(src_ptr.add(i + 4)); | ||
| 35 | + let v3 = vld1q_u64(src_ptr.add(i + 6)); | ||
| 36 | + let v4 = vld1q_u64(src_ptr.add(i + 8)); | ||
| 37 | + let v5 = vld1q_u64(src_ptr.add(i + 10)); | ||
| 38 | + let v6 = vld1q_u64(src_ptr.add(i + 12)); | ||
| 39 | + let v7 = vld1q_u64(src_ptr.add(i + 14)); | ||
| 40 | + vst1q_u64(dst_ptr.add(i), v0); | ||
| 41 | + vst1q_u64(dst_ptr.add(i + 2), v1); | ||
| 42 | + vst1q_u64(dst_ptr.add(i + 4), v2); | ||
| 43 | + vst1q_u64(dst_ptr.add(i + 6), v3); | ||
| 44 | + vst1q_u64(dst_ptr.add(i + 8), v4); | ||
| 45 | + vst1q_u64(dst_ptr.add(i + 10), v5); | ||
| 46 | + vst1q_u64(dst_ptr.add(i + 12), v6); | ||
| 47 | + vst1q_u64(dst_ptr.add(i + 14), v7); | ||
| 48 | + i += 16; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + while i + 4 <= len { | ||
| 52 | + let v0 = vld1q_u64(src_ptr.add(i)); | ||
| 53 | + let v1 = vld1q_u64(src_ptr.add(i + 2)); | ||
| 54 | + vst1q_u64(dst_ptr.add(i), v0); | ||
| 55 | + vst1q_u64(dst_ptr.add(i + 2), v1); | ||
| 56 | + i += 4; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + while i < len { | ||
| 60 | + *dst_ptr.add(i) = *src_ptr.add(i); | ||
| 61 | + i += 1; | ||
| 62 | + } | ||
| 63 | +} | ||
| 64 | + | ||
| 65 | + | ||
| 66 | +unsafe fn clone_from_neon(dst: &mut Vec<usize>, src: &[usize]) { | ||
| 67 | + let src_len = src.len(); | ||
| 68 | + dst.clear(); | ||
| 69 | + dst.reserve(src_len); | ||
| 70 | + let dst_ptr = dst.as_mut_ptr() as *mut u64; | ||
| 71 | + let src_ptr = src.as_ptr() as *const u64; | ||
| 72 | + copy_slice_neon(dst_ptr, src_ptr, src_len); | ||
| 73 | + dst.set_len(src_len); | ||
| 74 | +} | ||
| 75 | + | ||
| 76 | + | ||
| 77 | +fn bench_clone_from_10_1000_1000_neon(b: &mut Bencher) { | ||
| 78 | + let dst: Vec<usize> = black_box((0..1000).collect()); | ||
| 79 | + let src: Vec<usize> = black_box((1000..2000).collect()); | ||
| 80 | + | ||
| 81 | + b.iter( | ||
| 82 | + || {}, | ||
| 83 | + |_| { | ||
| 84 | + let mut dst = dst.clone(); | ||
| 85 | + for _ in 0..10 { | ||
| 86 | + unsafe { clone_from_neon(&mut dst, &src) }; | ||
| 87 | + dst = black_box(dst); | ||
| 88 | + } | ||
| 89 | + dst | ||
| 90 | + }, | ||
| 91 | + ); | ||
| 92 | +} | ||
| 93 | + | ||
| 94 | + | ||
| 95 | + | ||
| 96 | +unsafe fn copy_slice_sve(dst_ptr: *mut u64, src_ptr: *const u64, len: usize) { | ||
| 97 | + let len64 = len as u64; | ||
| 98 | + let vl = svcntd(); | ||
| 99 | + let vl4 = vl * 4; | ||
| 100 | + | ||
| 101 | + let mut i = 0u64; | ||
| 102 | + | ||
| 103 | + while i + vl4 <= len64 { | ||
| 104 | + let pg = svptrue_b64(); | ||
| 105 | + let d0 = svld1_u64(pg, src_ptr.add(i as usize)); | ||
| 106 | + let d1 = svld1_u64(pg, src_ptr.add((i + vl) as usize)); | ||
| 107 | + let d2 = svld1_u64(pg, src_ptr.add((i + vl * 2) as usize)); | ||
| 108 | + let d3 = svld1_u64(pg, src_ptr.add((i + vl * 3) as usize)); | ||
| 109 | + svst1_u64(pg, dst_ptr.add(i as usize), d0); | ||
| 110 | + svst1_u64(pg, dst_ptr.add((i + vl) as usize), d1); | ||
| 111 | + svst1_u64(pg, dst_ptr.add((i + vl * 2) as usize), d2); | ||
| 112 | + svst1_u64(pg, dst_ptr.add((i + vl * 3) as usize), d3); | ||
| 113 | + i += vl4; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + while i < len64 { | ||
| 117 | + let pg = svwhilelt_b64_u64(i, len64); | ||
| 118 | + let data = svld1_u64(pg, src_ptr.add(i as usize)); | ||
| 119 | + svst1_u64(pg, dst_ptr.add(i as usize), data); | ||
| 120 | + i += vl; | ||
| 121 | + } | ||
| 122 | +} | ||
| 123 | + | ||
| 124 | + | ||
| 125 | + | ||
| 126 | +unsafe fn clone_from_sve(dst: &mut Vec<usize>, src: &[usize]) { | ||
| 127 | + let src_len = src.len(); | ||
| 128 | + dst.clear(); | ||
| 129 | + dst.reserve(src_len); | ||
| 130 | + let dst_ptr = dst.as_mut_ptr() as *mut u64; | ||
| 131 | + let src_ptr = src.as_ptr() as *const u64; | ||
| 132 | + copy_slice_sve(dst_ptr, src_ptr, src_len); | ||
| 133 | + dst.set_len(src_len); | ||
| 134 | +} | ||
| 135 | + | ||
| 136 | + | ||
| 137 | +fn bench_clone_from_10_1000_1000_sve(b: &mut Bencher) { | ||
| 138 | + let dst: Vec<usize> = black_box((0..1000).collect()); | ||
| 139 | + let src: Vec<usize> = black_box((1000..2000).collect()); | ||
| 140 | + | ||
| 141 | + b.iter( | ||
| 142 | + || {}, | ||
| 143 | + |_| { | ||
| 144 | + let mut dst = dst.clone(); | ||
| 145 | + for _ in 0..10 { | ||
| 146 | + unsafe { clone_from_sve(&mut dst, &src) }; | ||
| 147 | + dst = black_box(dst); | ||
| 148 | + } | ||
| 149 | + dst | ||
| 150 | + }, | ||
| 151 | + ); | ||
| 152 | +} | ||
| 153 | + | ||
| 154 | +fn main() { | ||
| 155 | + benchlib::benchmark::run_global_benchmark_group(); | ||
| 156 | +} | ||
| @@ -0,0 +1,455 @@ | |||
| 1 | +# This file is automatically @generated by Cargo. | ||
| 2 | +# It is not intended for manual editing. | ||
| 3 | +version = 4 | ||
| 4 | + | ||
| 5 | +[[package]] | ||
| 6 | +name = "aho-corasick" | ||
| 7 | +version = "1.1.4" | ||
| 8 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 9 | +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" | ||
| 10 | +dependencies = [ | ||
| 11 | + "memchr", | ||
| 12 | +] | ||
| 13 | + | ||
| 14 | +[[package]] | ||
| 15 | +name = "anstream" | ||
| 16 | +version = "1.0.0" | ||
| 17 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 18 | +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" | ||
| 19 | +dependencies = [ | ||
| 20 | + "anstyle", | ||
| 21 | + "anstyle-parse", | ||
| 22 | + "anstyle-query", | ||
| 23 | + "anstyle-wincon", | ||
| 24 | + "colorchoice", | ||
| 25 | + "is_terminal_polyfill", | ||
| 26 | + "utf8parse", | ||
| 27 | +] | ||
| 28 | + | ||
| 29 | +[[package]] | ||
| 30 | +name = "anstyle" | ||
| 31 | +version = "1.0.14" | ||
| 32 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 33 | +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" | ||
| 34 | + | ||
| 35 | +[[package]] | ||
| 36 | +name = "anstyle-parse" | ||
| 37 | +version = "1.0.0" | ||
| 38 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 39 | +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" | ||
| 40 | +dependencies = [ | ||
| 41 | + "utf8parse", | ||
| 42 | +] | ||
| 43 | + | ||
| 44 | +[[package]] | ||
| 45 | +name = "anstyle-query" | ||
| 46 | +version = "1.1.5" | ||
| 47 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 48 | +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" | ||
| 49 | +dependencies = [ | ||
| 50 | + "windows-sys", | ||
| 51 | +] | ||
| 52 | + | ||
| 53 | +[[package]] | ||
| 54 | +name = "anstyle-wincon" | ||
| 55 | +version = "3.0.11" | ||
| 56 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 57 | +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" | ||
| 58 | +dependencies = [ | ||
| 59 | + "anstyle", | ||
| 60 | + "once_cell_polyfill", | ||
| 61 | + "windows-sys", | ||
| 62 | +] | ||
| 63 | + | ||
| 64 | +[[package]] | ||
| 65 | +name = "anyhow" | ||
| 66 | +version = "1.0.102" | ||
| 67 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 68 | +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" | ||
| 69 | + | ||
| 70 | +[[package]] | ||
| 71 | +name = "bench-extend-1000-1000" | ||
| 72 | +version = "0.1.0" | ||
| 73 | +dependencies = [ | ||
| 74 | + "benchlib", | ||
| 75 | + "rustc_version", | ||
| 76 | +] | ||
| 77 | + | ||
| 78 | +[[package]] | ||
| 79 | +name = "benchlib" | ||
| 80 | +version = "0.1.0" | ||
| 81 | +dependencies = [ | ||
| 82 | + "anyhow", | ||
| 83 | + "benchlib-macros", | ||
| 84 | + "clap", | ||
| 85 | + "ctor", | ||
| 86 | + "env_logger", | ||
| 87 | + "libc", | ||
| 88 | + "log", | ||
| 89 | + "perf-event", | ||
| 90 | + "serde", | ||
| 91 | + "serde_json", | ||
| 92 | +] | ||
| 93 | + | ||
| 94 | +[[package]] | ||
| 95 | +name = "benchlib-macros" | ||
| 96 | +version = "0.1.0" | ||
| 97 | +dependencies = [ | ||
| 98 | + "proc-macro2", | ||
| 99 | + "quote", | ||
| 100 | + "syn", | ||
| 101 | +] | ||
| 102 | + | ||
| 103 | +[[package]] | ||
| 104 | +name = "bitflags" | ||
| 105 | +version = "2.13.0" | ||
| 106 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 107 | +checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" | ||
| 108 | + | ||
| 109 | +[[package]] | ||
| 110 | +name = "clap" | ||
| 111 | +version = "4.6.1" | ||
| 112 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 113 | +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" | ||
| 114 | +dependencies = [ | ||
| 115 | + "clap_builder", | ||
| 116 | + "clap_derive", | ||
| 117 | +] | ||
| 118 | + | ||
| 119 | +[[package]] | ||
| 120 | +name = "clap_builder" | ||
| 121 | +version = "4.6.0" | ||
| 122 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 123 | +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" | ||
| 124 | +dependencies = [ | ||
| 125 | + "anstream", | ||
| 126 | + "anstyle", | ||
| 127 | + "clap_lex", | ||
| 128 | + "strsim", | ||
| 129 | +] | ||
| 130 | + | ||
| 131 | +[[package]] | ||
| 132 | +name = "clap_derive" | ||
| 133 | +version = "4.6.1" | ||
| 134 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 135 | +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" | ||
| 136 | +dependencies = [ | ||
| 137 | + "heck", | ||
| 138 | + "proc-macro2", | ||
| 139 | + "quote", | ||
| 140 | + "syn", | ||
| 141 | +] | ||
| 142 | + | ||
| 143 | +[[package]] | ||
| 144 | +name = "clap_lex" | ||
| 145 | +version = "1.1.0" | ||
| 146 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 147 | +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" | ||
| 148 | + | ||
| 149 | +[[package]] | ||
| 150 | +name = "colorchoice" | ||
| 151 | +version = "1.0.5" | ||
| 152 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 153 | +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" | ||
| 154 | + | ||
| 155 | +[[package]] | ||
| 156 | +name = "ctor" | ||
| 157 | +version = "0.6.3" | ||
| 158 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 159 | +checksum = "424e0138278faeb2b401f174ad17e715c829512d74f3d1e81eb43365c2e0590e" | ||
| 160 | +dependencies = [ | ||
| 161 | + "ctor-proc-macro", | ||
| 162 | + "dtor", | ||
| 163 | +] | ||
| 164 | + | ||
| 165 | +[[package]] | ||
| 166 | +name = "ctor-proc-macro" | ||
| 167 | +version = "0.0.7" | ||
| 168 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 169 | +checksum = "52560adf09603e58c9a7ee1fe1dcb95a16927b17c127f0ac02d6e768a0e25bc1" | ||
| 170 | + | ||
| 171 | +[[package]] | ||
| 172 | +name = "dtor" | ||
| 173 | +version = "0.1.1" | ||
| 174 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 175 | +checksum = "404d02eeb088a82cfd873006cb713fe411306c7d182c344905e101fb1167d301" | ||
| 176 | +dependencies = [ | ||
| 177 | + "dtor-proc-macro", | ||
| 178 | +] | ||
| 179 | + | ||
| 180 | +[[package]] | ||
| 181 | +name = "dtor-proc-macro" | ||
| 182 | +version = "0.0.6" | ||
| 183 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 184 | +checksum = "f678cf4a922c215c63e0de95eb1ff08a958a81d47e485cf9da1e27bf6305cfa5" | ||
| 185 | + | ||
| 186 | +[[package]] | ||
| 187 | +name = "env_logger" | ||
| 188 | +version = "0.10.2" | ||
| 189 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 190 | +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" | ||
| 191 | +dependencies = [ | ||
| 192 | + "humantime", | ||
| 193 | + "is-terminal", | ||
| 194 | + "log", | ||
| 195 | + "regex", | ||
| 196 | + "termcolor", | ||
| 197 | +] | ||
| 198 | + | ||
| 199 | +[[package]] | ||
| 200 | +name = "heck" | ||
| 201 | +version = "0.5.0" | ||
| 202 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 203 | +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" | ||
| 204 | + | ||
| 205 | +[[package]] | ||
| 206 | +name = "hermit-abi" | ||
| 207 | +version = "0.5.2" | ||
| 208 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 209 | +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" | ||
| 210 | + | ||
| 211 | +[[package]] | ||
| 212 | +name = "humantime" | ||
| 213 | +version = "2.3.0" | ||
| 214 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 215 | +checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" | ||
| 216 | + | ||
| 217 | +[[package]] | ||
| 218 | +name = "is-terminal" | ||
| 219 | +version = "0.4.17" | ||
| 220 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 221 | +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" | ||
| 222 | +dependencies = [ | ||
| 223 | + "hermit-abi", | ||
| 224 | + "libc", | ||
| 225 | + "windows-sys", | ||
| 226 | +] | ||
| 227 | + | ||
| 228 | +[[package]] | ||
| 229 | +name = "is_terminal_polyfill" | ||
| 230 | +version = "1.70.2" | ||
| 231 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 232 | +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" | ||
| 233 | + | ||
| 234 | +[[package]] | ||
| 235 | +name = "itoa" | ||
| 236 | +version = "1.0.18" | ||
| 237 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 238 | +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" | ||
| 239 | + | ||
| 240 | +[[package]] | ||
| 241 | +name = "libc" | ||
| 242 | +version = "0.2.186" | ||
| 243 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 244 | +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" | ||
| 245 | + | ||
| 246 | +[[package]] | ||
| 247 | +name = "log" | ||
| 248 | +version = "0.4.32" | ||
| 249 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 250 | +checksum = "953f07c43838f8e6f9758cab68bf5bed85465e7587ebe0b823f1bcd81978ad3a" | ||
| 251 | + | ||
| 252 | +[[package]] | ||
| 253 | +name = "memchr" | ||
| 254 | +version = "2.8.1" | ||
| 255 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 256 | +checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8" | ||
| 257 | + | ||
| 258 | +[[package]] | ||
| 259 | +name = "once_cell_polyfill" | ||
| 260 | +version = "1.70.2" | ||
| 261 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 262 | +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" | ||
| 263 | + | ||
| 264 | +[[package]] | ||
| 265 | +name = "perf-event" | ||
| 266 | +version = "0.4.9" | ||
| 267 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 268 | +checksum = "c2529f39584dbaa980f4959510c963ae95f119c127c046012c2834365f694438" | ||
| 269 | +dependencies = [ | ||
| 270 | + "bitflags", | ||
| 271 | + "libc", | ||
| 272 | + "perf-event-open-sys", | ||
| 273 | +] | ||
| 274 | + | ||
| 275 | +[[package]] | ||
| 276 | +name = "perf-event-open-sys" | ||
| 277 | +version = "6.0.0" | ||
| 278 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 279 | +checksum = "a5f8d1487a4ffa23c80a1c355dd27235f9b66fb71ba0f261eb417e4fe8451347" | ||
| 280 | +dependencies = [ | ||
| 281 | + "libc", | ||
| 282 | +] | ||
| 283 | + | ||
| 284 | +[[package]] | ||
| 285 | +name = "proc-macro2" | ||
| 286 | +version = "1.0.106" | ||
| 287 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 288 | +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" | ||
| 289 | +dependencies = [ | ||
| 290 | + "unicode-ident", | ||
| 291 | +] | ||
| 292 | + | ||
| 293 | +[[package]] | ||
| 294 | +name = "quote" | ||
| 295 | +version = "1.0.45" | ||
| 296 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 297 | +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" | ||
| 298 | +dependencies = [ | ||
| 299 | + "proc-macro2", | ||
| 300 | +] | ||
| 301 | + | ||
| 302 | +[[package]] | ||
| 303 | +name = "regex" | ||
| 304 | +version = "1.12.3" | ||
| 305 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 306 | +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" | ||
| 307 | +dependencies = [ | ||
| 308 | + "aho-corasick", | ||
| 309 | + "memchr", | ||
| 310 | + "regex-automata", | ||
| 311 | + "regex-syntax", | ||
| 312 | +] | ||
| 313 | + | ||
| 314 | +[[package]] | ||
| 315 | +name = "regex-automata" | ||
| 316 | +version = "0.4.14" | ||
| 317 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 318 | +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" | ||
| 319 | +dependencies = [ | ||
| 320 | + "aho-corasick", | ||
| 321 | + "memchr", | ||
| 322 | + "regex-syntax", | ||
| 323 | +] | ||
| 324 | + | ||
| 325 | +[[package]] | ||
| 326 | +name = "regex-syntax" | ||
| 327 | +version = "0.8.10" | ||
| 328 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 329 | +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" | ||
| 330 | + | ||
| 331 | +[[package]] | ||
| 332 | +name = "rustc_version" | ||
| 333 | +version = "0.4.1" | ||
| 334 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 335 | +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" | ||
| 336 | +dependencies = [ | ||
| 337 | + "semver", | ||
| 338 | +] | ||
| 339 | + | ||
| 340 | +[[package]] | ||
| 341 | +name = "semver" | ||
| 342 | +version = "1.0.28" | ||
| 343 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 344 | +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" | ||
| 345 | + | ||
| 346 | +[[package]] | ||
| 347 | +name = "serde" | ||
| 348 | +version = "1.0.228" | ||
| 349 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 350 | +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" | ||
| 351 | +dependencies = [ | ||
| 352 | + "serde_core", | ||
| 353 | + "serde_derive", | ||
| 354 | +] | ||
| 355 | + | ||
| 356 | +[[package]] | ||
| 357 | +name = "serde_core" | ||
| 358 | +version = "1.0.228" | ||
| 359 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 360 | +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" | ||
| 361 | +dependencies = [ | ||
| 362 | + "serde_derive", | ||
| 363 | +] | ||
| 364 | + | ||
| 365 | +[[package]] | ||
| 366 | +name = "serde_derive" | ||
| 367 | +version = "1.0.228" | ||
| 368 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 369 | +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" | ||
| 370 | +dependencies = [ | ||
| 371 | + "proc-macro2", | ||
| 372 | + "quote", | ||
| 373 | + "syn", | ||
| 374 | +] | ||
| 375 | + | ||
| 376 | +[[package]] | ||
| 377 | +name = "serde_json" | ||
| 378 | +version = "1.0.150" | ||
| 379 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 380 | +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" | ||
| 381 | +dependencies = [ | ||
| 382 | + "itoa", | ||
| 383 | + "memchr", | ||
| 384 | + "serde", | ||
| 385 | + "serde_core", | ||
| 386 | + "zmij", | ||
| 387 | +] | ||
| 388 | + | ||
| 389 | +[[package]] | ||
| 390 | +name = "strsim" | ||
| 391 | +version = "0.11.1" | ||
| 392 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 393 | +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" | ||
| 394 | + | ||
| 395 | +[[package]] | ||
| 396 | +name = "syn" | ||
| 397 | +version = "2.0.117" | ||
| 398 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 399 | +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" | ||
| 400 | +dependencies = [ | ||
| 401 | + "proc-macro2", | ||
| 402 | + "quote", | ||
| 403 | + "unicode-ident", | ||
| 404 | +] | ||
| 405 | + | ||
| 406 | +[[package]] | ||
| 407 | +name = "termcolor" | ||
| 408 | +version = "1.4.1" | ||
| 409 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 410 | +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" | ||
| 411 | +dependencies = [ | ||
| 412 | + "winapi-util", | ||
| 413 | +] | ||
| 414 | + | ||
| 415 | +[[package]] | ||
| 416 | +name = "unicode-ident" | ||
| 417 | +version = "1.0.24" | ||
| 418 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 419 | +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" | ||
| 420 | + | ||
| 421 | +[[package]] | ||
| 422 | +name = "utf8parse" | ||
| 423 | +version = "0.2.2" | ||
| 424 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 425 | +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" | ||
| 426 | + | ||
| 427 | +[[package]] | ||
| 428 | +name = "winapi-util" | ||
| 429 | +version = "0.1.11" | ||
| 430 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 431 | +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" | ||
| 432 | +dependencies = [ | ||
| 433 | + "windows-sys", | ||
| 434 | +] | ||
| 435 | + | ||
| 436 | +[[package]] | ||
| 437 | +name = "windows-link" | ||
| 438 | +version = "0.2.1" | ||
| 439 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 440 | +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" | ||
| 441 | + | ||
| 442 | +[[package]] | ||
| 443 | +name = "windows-sys" | ||
| 444 | +version = "0.61.2" | ||
| 445 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 446 | +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" | ||
| 447 | +dependencies = [ | ||
| 448 | + "windows-link", | ||
| 449 | +] | ||
| 450 | + | ||
| 451 | +[[package]] | ||
| 452 | +name = "zmij" | ||
| 453 | +version = "1.0.21" | ||
| 454 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 455 | +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" | ||
| @@ -0,0 +1,12 @@ | |||
| 1 | +[package] | ||
| 2 | +name = "bench-extend-1000-1000" | ||
| 3 | +version = "0.1.0" | ||
| 4 | +edition = "2021" | ||
| 5 | + | ||
| 6 | +[dependencies] | ||
| 7 | +benchlib = { path = "../../benchlib" } | ||
| 8 | + | ||
| 9 | +[build-dependencies] | ||
| 10 | +rustc_version = "0.4" | ||
| 11 | + | ||
| 12 | +[workspace] | ||
| @@ -0,0 +1,6 @@ | |||
| 1 | +fn main() { | ||
| 2 | + println!("cargo:rustc-check-cfg=cfg(nightly)"); | ||
| 3 | + if matches!(rustc_version::version_meta().unwrap().channel, rustc_version::Channel::Nightly | rustc_version::Channel::Dev) { | ||
| 4 | + println!("cargo:rustc-cfg=nightly"); | ||
| 5 | + } | ||
| 6 | +} | ||
| @@ -0,0 +1,32 @@ | |||
| 1 | +[root@localhost rust-bench]# ./target/release/collector bench_runtime_local +nightly --group bench_extend_1000_1000 | ||
| 2 | +Using database `results.db` | ||
| 3 | +Compiling 1 runtime benchmark group(s) | ||
| 4 | +Compiling `bench_extend_1000_1000` (1/1) | ||
| 5 | +Executing 3 benchmarks | ||
| 6 | + | ||
| 7 | +Finished bench_extend_1000_1000/bench_extend_1000_1000::bench_extend_1000_1000 (1/3) | ||
| 8 | + [Instructions]: min: 6,144 mean: 6,187 stddev: 35 | ||
| 9 | + [Cycles]: min: 2,535 mean: 2,766 stddev: 122 | ||
| 10 | + [Wall time [ns]]: min: 630 mean: 668 stddev: 25 | ||
| 11 | + [Branch misses]: min: 6 mean: 7 stddev: 1 | ||
| 12 | + [Cache misses]: min: 88 mean: 97 stddev: 6 | ||
| 13 | +[Cache references]: min: 4,331 mean: 4,373 stddev: 29 | ||
| 14 | + [Memory [kb]]: Not available | ||
| 15 | + | ||
| 16 | +Finished bench_extend_1000_1000/bench_extend_1000_1000::bench_extend_1000_1000_neon (2/3) | ||
| 17 | + [Instructions]: min: 3,005 mean: 3,005 stddev: 0 | ||
| 18 | + [Cycles]: min: 2,093 mean: 2,242 stddev: 150 | ||
| 19 | + [Wall time [ns]]: min: 330 mean: 338 stddev: 7 | ||
| 20 | + [Branch misses]: min: 2 mean: 4 stddev: 1 | ||
| 21 | + [Cache misses]: min: 78 mean: 84 stddev: 3 | ||
| 22 | +[Cache references]: min: 2,011 mean: 2,035 stddev: 20 | ||
| 23 | + [Memory [kb]]: Not available | ||
| 24 | + | ||
| 25 | +Finished bench_extend_1000_1000/bench_extend_1000_1000::bench_extend_1000_1000_sve (3/3) | ||
| 26 | + [Instructions]: min: 2,938 mean: 2,949 stddev: 23 | ||
| 27 | + [Cycles]: min: 1,849 mean: 1,990 stddev: 128 | ||
| 28 | + [Wall time [ns]]: min: 330 mean: 356 stddev: 16 | ||
| 29 | + [Branch misses]: min: 3 mean: 5 stddev: 1 | ||
| 30 | + [Cache misses]: min: 81 mean: 89 stddev: 5 | ||
| 31 | +[Cache references]: min: 1,975 mean: 1,981 stddev: 5 | ||
| 32 | + [Memory [kb]]: Not available | ||
| @@ -0,0 +1,135 @@ | |||
| 1 | + | ||
| 2 | + | ||
| 3 | +use benchlib::benchmark::{bench, black_box, Bencher}; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +fn bench_extend_1000_1000(b: &mut Bencher) { | ||
| 7 | + let dst: Vec<usize> = black_box((0..1000).collect()); | ||
| 8 | + let src: Vec<usize> = black_box((1000..2000).collect()); | ||
| 9 | + | ||
| 10 | + b.iter( | ||
| 11 | + || {}, | ||
| 12 | + |_| { | ||
| 13 | + let mut dst = dst.clone(); | ||
| 14 | + dst.extend(src.clone()); | ||
| 15 | + dst | ||
| 16 | + }, | ||
| 17 | + ); | ||
| 18 | +} | ||
| 19 | + | ||
| 20 | + | ||
| 21 | +use std::arch::aarch64::*; | ||
| 22 | + | ||
| 23 | + | ||
| 24 | +unsafe fn extend_neon(dst: &mut Vec<usize>, src: &[usize]) { | ||
| 25 | + let src_len = src.len(); | ||
| 26 | + dst.reserve(src_len); | ||
| 27 | + let write_ptr = dst.as_mut_ptr().add(dst.len()) as *mut u64; | ||
| 28 | + let src_ptr = src.as_ptr() as *const u64; | ||
| 29 | + | ||
| 30 | + let mut i = 0usize; | ||
| 31 | + | ||
| 32 | + while i + 16 <= src_len { | ||
| 33 | + let v0 = vld1q_u64(src_ptr.add(i)); | ||
| 34 | + let v1 = vld1q_u64(src_ptr.add(i + 2)); | ||
| 35 | + let v2 = vld1q_u64(src_ptr.add(i + 4)); | ||
| 36 | + let v3 = vld1q_u64(src_ptr.add(i + 6)); | ||
| 37 | + let v4 = vld1q_u64(src_ptr.add(i + 8)); | ||
| 38 | + let v5 = vld1q_u64(src_ptr.add(i + 10)); | ||
| 39 | + let v6 = vld1q_u64(src_ptr.add(i + 12)); | ||
| 40 | + let v7 = vld1q_u64(src_ptr.add(i + 14)); | ||
| 41 | + vst1q_u64(write_ptr.add(i), v0); | ||
| 42 | + vst1q_u64(write_ptr.add(i + 2), v1); | ||
| 43 | + vst1q_u64(write_ptr.add(i + 4), v2); | ||
| 44 | + vst1q_u64(write_ptr.add(i + 6), v3); | ||
| 45 | + vst1q_u64(write_ptr.add(i + 8), v4); | ||
| 46 | + vst1q_u64(write_ptr.add(i + 10), v5); | ||
| 47 | + vst1q_u64(write_ptr.add(i + 12), v6); | ||
| 48 | + vst1q_u64(write_ptr.add(i + 14), v7); | ||
| 49 | + i += 16; | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + while i + 4 <= src_len { | ||
| 53 | + let v0 = vld1q_u64(src_ptr.add(i)); | ||
| 54 | + let v1 = vld1q_u64(src_ptr.add(i + 2)); | ||
| 55 | + vst1q_u64(write_ptr.add(i), v0); | ||
| 56 | + vst1q_u64(write_ptr.add(i + 2), v1); | ||
| 57 | + i += 4; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + while i < src_len { | ||
| 61 | + *write_ptr.add(i) = *src_ptr.add(i); | ||
| 62 | + i += 1; | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + dst.set_len(dst.len() + src_len); | ||
| 66 | +} | ||
| 67 | + | ||
| 68 | + | ||
| 69 | +fn bench_extend_1000_1000_neon(b: &mut Bencher) { | ||
| 70 | + let dst: Vec<usize> = black_box((0..1000).collect()); | ||
| 71 | + let src: Vec<usize> = black_box((1000..2000).collect()); | ||
| 72 | + | ||
| 73 | + b.iter( | ||
| 74 | + || {}, | ||
| 75 | + |_| { | ||
| 76 | + let mut dst = dst.clone(); | ||
| 77 | + unsafe { extend_neon(&mut dst, &src) }; | ||
| 78 | + dst | ||
| 79 | + }, | ||
| 80 | + ); | ||
| 81 | +} | ||
| 82 | + | ||
| 83 | + | ||
| 84 | + | ||
| 85 | +unsafe fn extend_sve(dst: &mut Vec<usize>, src: &[usize]) { | ||
| 86 | + let src_len = src.len() as u64; | ||
| 87 | + dst.reserve(src_len as usize); | ||
| 88 | + let write_ptr = dst.as_mut_ptr().add(dst.len()) as *mut u64; | ||
| 89 | + let src_ptr = src.as_ptr() as *const u64; | ||
| 90 | + let vl = svcntd(); | ||
| 91 | + let vl4 = vl * 4; | ||
| 92 | + | ||
| 93 | + let mut i = 0u64; | ||
| 94 | + | ||
| 95 | + while i + vl4 <= src_len { | ||
| 96 | + let pg = svptrue_b64(); | ||
| 97 | + let d0 = svld1_u64(pg, src_ptr.add(i as usize)); | ||
| 98 | + let d1 = svld1_u64(pg, src_ptr.add((i + vl) as usize)); | ||
| 99 | + let d2 = svld1_u64(pg, src_ptr.add((i + vl * 2) as usize)); | ||
| 100 | + let d3 = svld1_u64(pg, src_ptr.add((i + vl * 3) as usize)); | ||
| 101 | + svst1_u64(pg, write_ptr.add(i as usize), d0); | ||
| 102 | + svst1_u64(pg, write_ptr.add((i + vl) as usize), d1); | ||
| 103 | + svst1_u64(pg, write_ptr.add((i + vl * 2) as usize), d2); | ||
| 104 | + svst1_u64(pg, write_ptr.add((i + vl * 3) as usize), d3); | ||
| 105 | + i += vl4; | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | + while i < src_len { | ||
| 109 | + let pg = svwhilelt_b64_u64(i, src_len); | ||
| 110 | + let data = svld1_u64(pg, src_ptr.add(i as usize)); | ||
| 111 | + svst1_u64(pg, write_ptr.add(i as usize), data); | ||
| 112 | + i += vl; | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + dst.set_len(dst.len() + src_len as usize); | ||
| 116 | +} | ||
| 117 | + | ||
| 118 | + | ||
| 119 | +fn bench_extend_1000_1000_sve(b: &mut Bencher) { | ||
| 120 | + let dst: Vec<usize> = black_box((0..1000).collect()); | ||
| 121 | + let src: Vec<usize> = black_box((1000..2000).collect()); | ||
| 122 | + | ||
| 123 | + b.iter( | ||
| 124 | + || {}, | ||
| 125 | + |_| { | ||
| 126 | + let mut dst = dst.clone(); | ||
| 127 | + unsafe { extend_sve(&mut dst, &src) }; | ||
| 128 | + dst | ||
| 129 | + }, | ||
| 130 | + ); | ||
| 131 | +} | ||
| 132 | + | ||
| 133 | +fn main() { | ||
| 134 | + benchlib::benchmark::run_global_benchmark_group(); | ||
| 135 | +} | ||
| @@ -0,0 +1,455 @@ | |||
| 1 | +# This file is automatically @generated by Cargo. | ||
| 2 | +# It is not intended for manual editing. | ||
| 3 | +version = 4 | ||
| 4 | + | ||
| 5 | +[[package]] | ||
| 6 | +name = "aho-corasick" | ||
| 7 | +version = "1.1.4" | ||
| 8 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 9 | +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" | ||
| 10 | +dependencies = [ | ||
| 11 | + "memchr", | ||
| 12 | +] | ||
| 13 | + | ||
| 14 | +[[package]] | ||
| 15 | +name = "anstream" | ||
| 16 | +version = "1.0.0" | ||
| 17 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 18 | +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" | ||
| 19 | +dependencies = [ | ||
| 20 | + "anstyle", | ||
| 21 | + "anstyle-parse", | ||
| 22 | + "anstyle-query", | ||
| 23 | + "anstyle-wincon", | ||
| 24 | + "colorchoice", | ||
| 25 | + "is_terminal_polyfill", | ||
| 26 | + "utf8parse", | ||
| 27 | +] | ||
| 28 | + | ||
| 29 | +[[package]] | ||
| 30 | +name = "anstyle" | ||
| 31 | +version = "1.0.14" | ||
| 32 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 33 | +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" | ||
| 34 | + | ||
| 35 | +[[package]] | ||
| 36 | +name = "anstyle-parse" | ||
| 37 | +version = "1.0.0" | ||
| 38 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 39 | +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" | ||
| 40 | +dependencies = [ | ||
| 41 | + "utf8parse", | ||
| 42 | +] | ||
| 43 | + | ||
| 44 | +[[package]] | ||
| 45 | +name = "anstyle-query" | ||
| 46 | +version = "1.1.5" | ||
| 47 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 48 | +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" | ||
| 49 | +dependencies = [ | ||
| 50 | + "windows-sys", | ||
| 51 | +] | ||
| 52 | + | ||
| 53 | +[[package]] | ||
| 54 | +name = "anstyle-wincon" | ||
| 55 | +version = "3.0.11" | ||
| 56 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 57 | +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" | ||
| 58 | +dependencies = [ | ||
| 59 | + "anstyle", | ||
| 60 | + "once_cell_polyfill", | ||
| 61 | + "windows-sys", | ||
| 62 | +] | ||
| 63 | + | ||
| 64 | +[[package]] | ||
| 65 | +name = "anyhow" | ||
| 66 | +version = "1.0.102" | ||
| 67 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 68 | +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" | ||
| 69 | + | ||
| 70 | +[[package]] | ||
| 71 | +name = "bench-extend-from-slice-1000-1000" | ||
| 72 | +version = "0.1.0" | ||
| 73 | +dependencies = [ | ||
| 74 | + "benchlib", | ||
| 75 | + "rustc_version", | ||
| 76 | +] | ||
| 77 | + | ||
| 78 | +[[package]] | ||
| 79 | +name = "benchlib" | ||
| 80 | +version = "0.1.0" | ||
| 81 | +dependencies = [ | ||
| 82 | + "anyhow", | ||
| 83 | + "benchlib-macros", | ||
| 84 | + "clap", | ||
| 85 | + "ctor", | ||
| 86 | + "env_logger", | ||
| 87 | + "libc", | ||
| 88 | + "log", | ||
| 89 | + "perf-event", | ||
| 90 | + "serde", | ||
| 91 | + "serde_json", | ||
| 92 | +] | ||
| 93 | + | ||
| 94 | +[[package]] | ||
| 95 | +name = "benchlib-macros" | ||
| 96 | +version = "0.1.0" | ||
| 97 | +dependencies = [ | ||
| 98 | + "proc-macro2", | ||
| 99 | + "quote", | ||
| 100 | + "syn", | ||
| 101 | +] | ||
| 102 | + | ||
| 103 | +[[package]] | ||
| 104 | +name = "bitflags" | ||
| 105 | +version = "2.13.0" | ||
| 106 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 107 | +checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" | ||
| 108 | + | ||
| 109 | +[[package]] | ||
| 110 | +name = "clap" | ||
| 111 | +version = "4.6.1" | ||
| 112 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 113 | +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" | ||
| 114 | +dependencies = [ | ||
| 115 | + "clap_builder", | ||
| 116 | + "clap_derive", | ||
| 117 | +] | ||
| 118 | + | ||
| 119 | +[[package]] | ||
| 120 | +name = "clap_builder" | ||
| 121 | +version = "4.6.0" | ||
| 122 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 123 | +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" | ||
| 124 | +dependencies = [ | ||
| 125 | + "anstream", | ||
| 126 | + "anstyle", | ||
| 127 | + "clap_lex", | ||
| 128 | + "strsim", | ||
| 129 | +] | ||
| 130 | + | ||
| 131 | +[[package]] | ||
| 132 | +name = "clap_derive" | ||
| 133 | +version = "4.6.1" | ||
| 134 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 135 | +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" | ||
| 136 | +dependencies = [ | ||
| 137 | + "heck", | ||
| 138 | + "proc-macro2", | ||
| 139 | + "quote", | ||
| 140 | + "syn", | ||
| 141 | +] | ||
| 142 | + | ||
| 143 | +[[package]] | ||
| 144 | +name = "clap_lex" | ||
| 145 | +version = "1.1.0" | ||
| 146 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 147 | +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" | ||
| 148 | + | ||
| 149 | +[[package]] | ||
| 150 | +name = "colorchoice" | ||
| 151 | +version = "1.0.5" | ||
| 152 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 153 | +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" | ||
| 154 | + | ||
| 155 | +[[package]] | ||
| 156 | +name = "ctor" | ||
| 157 | +version = "0.6.3" | ||
| 158 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 159 | +checksum = "424e0138278faeb2b401f174ad17e715c829512d74f3d1e81eb43365c2e0590e" | ||
| 160 | +dependencies = [ | ||
| 161 | + "ctor-proc-macro", | ||
| 162 | + "dtor", | ||
| 163 | +] | ||
| 164 | + | ||
| 165 | +[[package]] | ||
| 166 | +name = "ctor-proc-macro" | ||
| 167 | +version = "0.0.7" | ||
| 168 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 169 | +checksum = "52560adf09603e58c9a7ee1fe1dcb95a16927b17c127f0ac02d6e768a0e25bc1" | ||
| 170 | + | ||
| 171 | +[[package]] | ||
| 172 | +name = "dtor" | ||
| 173 | +version = "0.1.1" | ||
| 174 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 175 | +checksum = "404d02eeb088a82cfd873006cb713fe411306c7d182c344905e101fb1167d301" | ||
| 176 | +dependencies = [ | ||
| 177 | + "dtor-proc-macro", | ||
| 178 | +] | ||
| 179 | + | ||
| 180 | +[[package]] | ||
| 181 | +name = "dtor-proc-macro" | ||
| 182 | +version = "0.0.6" | ||
| 183 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 184 | +checksum = "f678cf4a922c215c63e0de95eb1ff08a958a81d47e485cf9da1e27bf6305cfa5" | ||
| 185 | + | ||
| 186 | +[[package]] | ||
| 187 | +name = "env_logger" | ||
| 188 | +version = "0.10.2" | ||
| 189 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 190 | +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" | ||
| 191 | +dependencies = [ | ||
| 192 | + "humantime", | ||
| 193 | + "is-terminal", | ||
| 194 | + "log", | ||
| 195 | + "regex", | ||
| 196 | + "termcolor", | ||
| 197 | +] | ||
| 198 | + | ||
| 199 | +[[package]] | ||
| 200 | +name = "heck" | ||
| 201 | +version = "0.5.0" | ||
| 202 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 203 | +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" | ||
| 204 | + | ||
| 205 | +[[package]] | ||
| 206 | +name = "hermit-abi" | ||
| 207 | +version = "0.5.2" | ||
| 208 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 209 | +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" | ||
| 210 | + | ||
| 211 | +[[package]] | ||
| 212 | +name = "humantime" | ||
| 213 | +version = "2.3.0" | ||
| 214 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 215 | +checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" | ||
| 216 | + | ||
| 217 | +[[package]] | ||
| 218 | +name = "is-terminal" | ||
| 219 | +version = "0.4.17" | ||
| 220 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 221 | +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" | ||
| 222 | +dependencies = [ | ||
| 223 | + "hermit-abi", | ||
| 224 | + "libc", | ||
| 225 | + "windows-sys", | ||
| 226 | +] | ||
| 227 | + | ||
| 228 | +[[package]] | ||
| 229 | +name = "is_terminal_polyfill" | ||
| 230 | +version = "1.70.2" | ||
| 231 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 232 | +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" | ||
| 233 | + | ||
| 234 | +[[package]] | ||
| 235 | +name = "itoa" | ||
| 236 | +version = "1.0.18" | ||
| 237 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 238 | +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" | ||
| 239 | + | ||
| 240 | +[[package]] | ||
| 241 | +name = "libc" | ||
| 242 | +version = "0.2.186" | ||
| 243 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 244 | +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" | ||
| 245 | + | ||
| 246 | +[[package]] | ||
| 247 | +name = "log" | ||
| 248 | +version = "0.4.32" | ||
| 249 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 250 | +checksum = "953f07c43838f8e6f9758cab68bf5bed85465e7587ebe0b823f1bcd81978ad3a" | ||
| 251 | + | ||
| 252 | +[[package]] | ||
| 253 | +name = "memchr" | ||
| 254 | +version = "2.8.1" | ||
| 255 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 256 | +checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8" | ||
| 257 | + | ||
| 258 | +[[package]] | ||
| 259 | +name = "once_cell_polyfill" | ||
| 260 | +version = "1.70.2" | ||
| 261 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 262 | +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" | ||
| 263 | + | ||
| 264 | +[[package]] | ||
| 265 | +name = "perf-event" | ||
| 266 | +version = "0.4.9" | ||
| 267 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 268 | +checksum = "c2529f39584dbaa980f4959510c963ae95f119c127c046012c2834365f694438" | ||
| 269 | +dependencies = [ | ||
| 270 | + "bitflags", | ||
| 271 | + "libc", | ||
| 272 | + "perf-event-open-sys", | ||
| 273 | +] | ||
| 274 | + | ||
| 275 | +[[package]] | ||
| 276 | +name = "perf-event-open-sys" | ||
| 277 | +version = "6.0.0" | ||
| 278 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 279 | +checksum = "a5f8d1487a4ffa23c80a1c355dd27235f9b66fb71ba0f261eb417e4fe8451347" | ||
| 280 | +dependencies = [ | ||
| 281 | + "libc", | ||
| 282 | +] | ||
| 283 | + | ||
| 284 | +[[package]] | ||
| 285 | +name = "proc-macro2" | ||
| 286 | +version = "1.0.106" | ||
| 287 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 288 | +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" | ||
| 289 | +dependencies = [ | ||
| 290 | + "unicode-ident", | ||
| 291 | +] | ||
| 292 | + | ||
| 293 | +[[package]] | ||
| 294 | +name = "quote" | ||
| 295 | +version = "1.0.45" | ||
| 296 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 297 | +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" | ||
| 298 | +dependencies = [ | ||
| 299 | + "proc-macro2", | ||
| 300 | +] | ||
| 301 | + | ||
| 302 | +[[package]] | ||
| 303 | +name = "regex" | ||
| 304 | +version = "1.12.3" | ||
| 305 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 306 | +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" | ||
| 307 | +dependencies = [ | ||
| 308 | + "aho-corasick", | ||
| 309 | + "memchr", | ||
| 310 | + "regex-automata", | ||
| 311 | + "regex-syntax", | ||
| 312 | +] | ||
| 313 | + | ||
| 314 | +[[package]] | ||
| 315 | +name = "regex-automata" | ||
| 316 | +version = "0.4.14" | ||
| 317 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 318 | +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" | ||
| 319 | +dependencies = [ | ||
| 320 | + "aho-corasick", | ||
| 321 | + "memchr", | ||
| 322 | + "regex-syntax", | ||
| 323 | +] | ||
| 324 | + | ||
| 325 | +[[package]] | ||
| 326 | +name = "regex-syntax" | ||
| 327 | +version = "0.8.10" | ||
| 328 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 329 | +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" | ||
| 330 | + | ||
| 331 | +[[package]] | ||
| 332 | +name = "rustc_version" | ||
| 333 | +version = "0.4.1" | ||
| 334 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 335 | +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" | ||
| 336 | +dependencies = [ | ||
| 337 | + "semver", | ||
| 338 | +] | ||
| 339 | + | ||
| 340 | +[[package]] | ||
| 341 | +name = "semver" | ||
| 342 | +version = "1.0.28" | ||
| 343 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 344 | +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" | ||
| 345 | + | ||
| 346 | +[[package]] | ||
| 347 | +name = "serde" | ||
| 348 | +version = "1.0.228" | ||
| 349 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 350 | +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" | ||
| 351 | +dependencies = [ | ||
| 352 | + "serde_core", | ||
| 353 | + "serde_derive", | ||
| 354 | +] | ||
| 355 | + | ||
| 356 | +[[package]] | ||
| 357 | +name = "serde_core" | ||
| 358 | +version = "1.0.228" | ||
| 359 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 360 | +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" | ||
| 361 | +dependencies = [ | ||
| 362 | + "serde_derive", | ||
| 363 | +] | ||
| 364 | + | ||
| 365 | +[[package]] | ||
| 366 | +name = "serde_derive" | ||
| 367 | +version = "1.0.228" | ||
| 368 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 369 | +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" | ||
| 370 | +dependencies = [ | ||
| 371 | + "proc-macro2", | ||
| 372 | + "quote", | ||
| 373 | + "syn", | ||
| 374 | +] | ||
| 375 | + | ||
| 376 | +[[package]] | ||
| 377 | +name = "serde_json" | ||
| 378 | +version = "1.0.150" | ||
| 379 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 380 | +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" | ||
| 381 | +dependencies = [ | ||
| 382 | + "itoa", | ||
| 383 | + "memchr", | ||
| 384 | + "serde", | ||
| 385 | + "serde_core", | ||
| 386 | + "zmij", | ||
| 387 | +] | ||
| 388 | + | ||
| 389 | +[[package]] | ||
| 390 | +name = "strsim" | ||
| 391 | +version = "0.11.1" | ||
| 392 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 393 | +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" | ||
| 394 | + | ||
| 395 | +[[package]] | ||
| 396 | +name = "syn" | ||
| 397 | +version = "2.0.117" | ||
| 398 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 399 | +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" | ||
| 400 | +dependencies = [ | ||
| 401 | + "proc-macro2", | ||
| 402 | + "quote", | ||
| 403 | + "unicode-ident", | ||
| 404 | +] | ||
| 405 | + | ||
| 406 | +[[package]] | ||
| 407 | +name = "termcolor" | ||
| 408 | +version = "1.4.1" | ||
| 409 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 410 | +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" | ||
| 411 | +dependencies = [ | ||
| 412 | + "winapi-util", | ||
| 413 | +] | ||
| 414 | + | ||
| 415 | +[[package]] | ||
| 416 | +name = "unicode-ident" | ||
| 417 | +version = "1.0.24" | ||
| 418 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 419 | +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" | ||
| 420 | + | ||
| 421 | +[[package]] | ||
| 422 | +name = "utf8parse" | ||
| 423 | +version = "0.2.2" | ||
| 424 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 425 | +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" | ||
| 426 | + | ||
| 427 | +[[package]] | ||
| 428 | +name = "winapi-util" | ||
| 429 | +version = "0.1.11" | ||
| 430 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 431 | +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" | ||
| 432 | +dependencies = [ | ||
| 433 | + "windows-sys", | ||
| 434 | +] | ||
| 435 | + | ||
| 436 | +[[package]] | ||
| 437 | +name = "windows-link" | ||
| 438 | +version = "0.2.1" | ||
| 439 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 440 | +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" | ||
| 441 | + | ||
| 442 | +[[package]] | ||
| 443 | +name = "windows-sys" | ||
| 444 | +version = "0.61.2" | ||
| 445 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 446 | +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" | ||
| 447 | +dependencies = [ | ||
| 448 | + "windows-link", | ||
| 449 | +] | ||
| 450 | + | ||
| 451 | +[[package]] | ||
| 452 | +name = "zmij" | ||
| 453 | +version = "1.0.21" | ||
| 454 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 455 | +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" | ||
| @@ -0,0 +1,12 @@ | |||
| 1 | +[package] | ||
| 2 | +name = "bench-extend-from-slice-1000-1000" | ||
| 3 | +version = "0.1.0" | ||
| 4 | +edition = "2021" | ||
| 5 | + | ||
| 6 | +[dependencies] | ||
| 7 | +benchlib = { path = "../../benchlib" } | ||
| 8 | + | ||
| 9 | +[build-dependencies] | ||
| 10 | +rustc_version = "0.4" | ||
| 11 | + | ||
| 12 | +[workspace] | ||
| @@ -0,0 +1,6 @@ | |||
| 1 | +fn main() { | ||
| 2 | + println!("cargo:rustc-check-cfg=cfg(nightly)"); | ||
| 3 | + if matches!(rustc_version::version_meta().unwrap().channel, rustc_version::Channel::Nightly | rustc_version::Channel::Dev) { | ||
| 4 | + println!("cargo:rustc-cfg=nightly"); | ||
| 5 | + } | ||
| 6 | +} | ||
| @@ -0,0 +1,72 @@ | |||
| 1 | +[root@localhost rust-bench]# ./target/release/collector bench_runtime_local +nightly --group bench_extend_from_slice_1000_1000 | ||
| 2 | +Using database `results.db` | ||
| 3 | +Compiling 1 runtime benchmark group(s) | ||
| 4 | +Compiling `bench_extend_from_slice_1000_1000` (1/1) | ||
| 5 | +Executing 3 benchmarks | ||
| 6 | + | ||
| 7 | +Finished bench_extend_from_slice_1000_1000/bench_extend_from_slice_1000_1000::bench_extend_from_slice_1000_1000 (1/3) | ||
| 8 | + [Instructions]: min: 2,976 mean: 3,019 stddev: 35 | ||
| 9 | + [Cycles]: min: 1,488 mean: 1,711 stddev: 204 | ||
| 10 | + [Wall time [ns]]: min: 320 mean: 330 stddev: 6 | ||
| 11 | + [Branch misses]: min: 4 mean: 5 stddev: 1 | ||
| 12 | + [Cache misses]: min: 75 mean: 78 stddev: 3 | ||
| 13 | +[Cache references]: min: 2,133 mean: 2,143 stddev: 8 | ||
| 14 | + [Memory [kb]]: Not available | ||
| 15 | + | ||
| 16 | +Finished bench_extend_from_slice_1000_1000/bench_extend_from_slice_1000_1000::bench_extend_from_slice_1000_1000_neon (2/3) | ||
| 17 | + [Instructions]: min: 3,929 mean: 3,961 stddev: 22 | ||
| 18 | + [Cycles]: min: 1,679 mean: 2,013 stddev: 206 | ||
| 19 | + [Wall time [ns]]: min: 340 mean: 352 stddev: 9 | ||
| 20 | + [Branch misses]: min: 3 mean: 5 stddev: 2 | ||
| 21 | + [Cache misses]: min: 79 mean: 83 stddev: 2 | ||
| 22 | +[Cache references]: min: 1,958 mean: 1,973 stddev: 17 | ||
| 23 | + [Memory [kb]]: Not available | ||
| 24 | + | ||
| 25 | +Finished bench_extend_from_slice_1000_1000/bench_extend_from_slice_1000_1000::bench_extend_from_slice_1000_1000_sve (3/3) | ||
| 26 | + [Instructions]: min: 3,425 mean: 3,434 stddev: 11 | ||
| 27 | + [Cycles]: min: 1,577 mean: 1,852 stddev: 194 | ||
| 28 | + [Wall time [ns]]: min: 350 mean: 360 stddev: 6 | ||
| 29 | + [Branch misses]: min: 5 mean: 7 stddev: 1 | ||
| 30 | + [Cache misses]: min: 71 mean: 74 stddev: 3 | ||
| 31 | +[Cache references]: min: 1,969 mean: 1,984 stddev: 13 | ||
| 32 | + [Memory [kb]]: Not available | ||
| 33 | + | ||
| 34 | +[root@localhost rust-bench]# ./target/release/collector bench_runtime_local +nightly --group bench_extend_from_slice_1000_1000 | ||
| 35 | +Using database `results.db` | ||
| 36 | +Compiling 1 runtime benchmark group(s) | ||
| 37 | +Compiling `bench_extend_from_slice_1000_1000` (1/1) | ||
| 38 | +Executing 0 benchmarks | ||
| 39 | + | ||
| 40 | +skipping bench_extend_from_slice_1000_1000 -- already benchmarked | ||
| 41 | +[root@localhost rust-bench]# ./target/release/collector bench_runtime_local +nightly --group bench_extend_from_slice_1000_1000 | ||
| 42 | +Using database `results.db` | ||
| 43 | +Compiling 1 runtime benchmark group(s) | ||
| 44 | +Compiling `bench_extend_from_slice_1000_1000` (1/1) | ||
| 45 | +Executing 3 benchmarks | ||
| 46 | + | ||
| 47 | +Finished bench_extend_from_slice_1000_1000/bench_extend_from_slice_1000_1000::bench_extend_from_slice_1000_1000 (1/3) | ||
| 48 | + [Instructions]: min: 2,976 mean: 3,019 stddev: 35 | ||
| 49 | + [Cycles]: min: 1,394 mean: 1,726 stddev: 189 | ||
| 50 | + [Wall time [ns]]: min: 300 mean: 326 stddev: 14 | ||
| 51 | + [Branch misses]: min: 4 mean: 4 stddev: 0 | ||
| 52 | + [Cache misses]: min: 75 mean: 77 stddev: 1 | ||
| 53 | +[Cache references]: min: 2,127 mean: 2,139 stddev: 10 | ||
| 54 | + [Memory [kb]]: Not available | ||
| 55 | + | ||
| 56 | +Finished bench_extend_from_slice_1000_1000/bench_extend_from_slice_1000_1000::bench_extend_from_slice_1000_1000_neon (2/3) | ||
| 57 | + [Instructions]: min: 3,005 mean: 3,037 stddev: 22 | ||
| 58 | + [Cycles]: min: 1,589 mean: 1,699 stddev: 72 | ||
| 59 | + [Wall time [ns]]: min: 300 mean: 342 stddev: 24 | ||
| 60 | + [Branch misses]: min: 6 mean: 8 stddev: 2 | ||
| 61 | + [Cache misses]: min: 70 mean: 78 stddev: 6 | ||
| 62 | +[Cache references]: min: 2,041 mean: 2,049 stddev: 8 | ||
| 63 | + [Memory [kb]]: Not available | ||
| 64 | + | ||
| 65 | +Finished bench_extend_from_slice_1000_1000/bench_extend_from_slice_1000_1000::bench_extend_from_slice_1000_1000_sve (3/3) | ||
| 66 | + [Instructions]: min: 2,937 mean: 2,969 stddev: 22 | ||
| 67 | + [Cycles]: min: 1,459 mean: 1,531 stddev: 57 | ||
| 68 | + [Wall time [ns]]: min: 340 mean: 362 stddev: 22 | ||
| 69 | + [Branch misses]: min: 4 mean: 5 stddev: 1 | ||
| 70 | + [Cache misses]: min: 74 mean: 83 stddev: 5 | ||
| 71 | +[Cache references]: min: 1,980 mean: 1,994 stddev: 15 | ||
| 72 | + [Memory [kb]]: Not available | ||
| @@ -0,0 +1,139 @@ | |||
| 1 | + | ||
| 2 | + | ||
| 3 | +use benchlib::benchmark::{bench, black_box, Bencher}; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +fn bench_extend_from_slice_1000_1000(b: &mut Bencher) { | ||
| 7 | + let dst: Vec<usize> = black_box((0..1000).collect()); | ||
| 8 | + let src: Vec<usize> = black_box((1000..2000).collect()); | ||
| 9 | + | ||
| 10 | + b.iter( | ||
| 11 | + || {}, | ||
| 12 | + |_| { | ||
| 13 | + let mut dst = dst.clone(); | ||
| 14 | + dst.extend_from_slice(&src); | ||
| 15 | + dst | ||
| 16 | + }, | ||
| 17 | + ); | ||
| 18 | +} | ||
| 19 | + | ||
| 20 | + | ||
| 21 | +use std::arch::aarch64::*; | ||
| 22 | + | ||
| 23 | + | ||
| 24 | +unsafe fn extend_from_slice_neon(dst: &mut Vec<usize>, src: &[usize]) { | ||
| 25 | + let src_len = src.len(); | ||
| 26 | + dst.reserve(src_len); | ||
| 27 | + let write_ptr = dst.as_mut_ptr().add(dst.len()) as *mut u64; | ||
| 28 | + let src_ptr = src.as_ptr() as *const u64; | ||
| 29 | + | ||
| 30 | + let mut i = 0usize; | ||
| 31 | + | ||
| 32 | + // Unroll 4x: copy 16 u64 (128 bytes) per iteration | ||
| 33 | + while i + 16 <= src_len { | ||
| 34 | + let v0 = vld1q_u64(src_ptr.add(i)); | ||
| 35 | + let v1 = vld1q_u64(src_ptr.add(i + 2)); | ||
| 36 | + let v2 = vld1q_u64(src_ptr.add(i + 4)); | ||
| 37 | + let v3 = vld1q_u64(src_ptr.add(i + 6)); | ||
| 38 | + let v4 = vld1q_u64(src_ptr.add(i + 8)); | ||
| 39 | + let v5 = vld1q_u64(src_ptr.add(i + 10)); | ||
| 40 | + let v6 = vld1q_u64(src_ptr.add(i + 12)); | ||
| 41 | + let v7 = vld1q_u64(src_ptr.add(i + 14)); | ||
| 42 | + vst1q_u64(write_ptr.add(i), v0); | ||
| 43 | + vst1q_u64(write_ptr.add(i + 2), v1); | ||
| 44 | + vst1q_u64(write_ptr.add(i + 4), v2); | ||
| 45 | + vst1q_u64(write_ptr.add(i + 6), v3); | ||
| 46 | + vst1q_u64(write_ptr.add(i + 8), v4); | ||
| 47 | + vst1q_u64(write_ptr.add(i + 10), v5); | ||
| 48 | + vst1q_u64(write_ptr.add(i + 12), v6); | ||
| 49 | + vst1q_u64(write_ptr.add(i + 14), v7); | ||
| 50 | + i += 16; | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + // Handle remaining in groups of 4 | ||
| 54 | + while i + 4 <= src_len { | ||
| 55 | + let v0 = vld1q_u64(src_ptr.add(i)); | ||
| 56 | + let v1 = vld1q_u64(src_ptr.add(i + 2)); | ||
| 57 | + vst1q_u64(write_ptr.add(i), v0); | ||
| 58 | + vst1q_u64(write_ptr.add(i + 2), v1); | ||
| 59 | + i += 4; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + while i < src_len { | ||
| 63 | + *write_ptr.add(i) = *src_ptr.add(i); | ||
| 64 | + i += 1; | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + dst.set_len(dst.len() + src_len); | ||
| 68 | +} | ||
| 69 | + | ||
| 70 | + | ||
| 71 | +fn bench_extend_from_slice_1000_1000_neon(b: &mut Bencher) { | ||
| 72 | + let dst: Vec<usize> = black_box((0..1000).collect()); | ||
| 73 | + let src: Vec<usize> = black_box((1000..2000).collect()); | ||
| 74 | + | ||
| 75 | + b.iter( | ||
| 76 | + || {}, | ||
| 77 | + |_| { | ||
| 78 | + let mut dst = dst.clone(); | ||
| 79 | + unsafe { extend_from_slice_neon(&mut dst, &src) }; | ||
| 80 | + dst | ||
| 81 | + }, | ||
| 82 | + ); | ||
| 83 | +} | ||
| 84 | + | ||
| 85 | + | ||
| 86 | + | ||
| 87 | +unsafe fn extend_from_slice_sve(dst: &mut Vec<usize>, src: &[usize]) { | ||
| 88 | + let src_len = src.len() as u64; | ||
| 89 | + dst.reserve(src_len as usize); | ||
| 90 | + let write_ptr = dst.as_mut_ptr().add(dst.len()) as *mut u64; | ||
| 91 | + let src_ptr = src.as_ptr() as *const u64; | ||
| 92 | + let vl = svcntd(); | ||
| 93 | + let vl4 = vl * 4; | ||
| 94 | + | ||
| 95 | + let mut i = 0u64; | ||
| 96 | + | ||
| 97 | + // Unroll 4x: copy 4 SVE vectors per iteration | ||
| 98 | + while i + vl4 <= src_len { | ||
| 99 | + let pg = svptrue_b64(); | ||
| 100 | + let d0 = svld1_u64(pg, src_ptr.add(i as usize)); | ||
| 101 | + let d1 = svld1_u64(pg, src_ptr.add((i + vl) as usize)); | ||
| 102 | + let d2 = svld1_u64(pg, src_ptr.add((i + vl * 2) as usize)); | ||
| 103 | + let d3 = svld1_u64(pg, src_ptr.add((i + vl * 3) as usize)); | ||
| 104 | + svst1_u64(pg, write_ptr.add(i as usize), d0); | ||
| 105 | + svst1_u64(pg, write_ptr.add((i + vl) as usize), d1); | ||
| 106 | + svst1_u64(pg, write_ptr.add((i + vl * 2) as usize), d2); | ||
| 107 | + svst1_u64(pg, write_ptr.add((i + vl * 3) as usize), d3); | ||
| 108 | + i += vl4; | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + // Handle remaining with predicated tail | ||
| 112 | + while i < src_len { | ||
| 113 | + let pg = svwhilelt_b64_u64(i, src_len); | ||
| 114 | + let data = svld1_u64(pg, src_ptr.add(i as usize)); | ||
| 115 | + svst1_u64(pg, write_ptr.add(i as usize), data); | ||
| 116 | + i += vl; | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + dst.set_len(dst.len() + src_len as usize); | ||
| 120 | +} | ||
| 121 | + | ||
| 122 | + | ||
| 123 | +fn bench_extend_from_slice_1000_1000_sve(b: &mut Bencher) { | ||
| 124 | + let dst: Vec<usize> = black_box((0..1000).collect()); | ||
| 125 | + let src: Vec<usize> = black_box((1000..2000).collect()); | ||
| 126 | + | ||
| 127 | + b.iter( | ||
| 128 | + || {}, | ||
| 129 | + |_| { | ||
| 130 | + let mut dst = dst.clone(); | ||
| 131 | + unsafe { extend_from_slice_sve(&mut dst, &src) }; | ||
| 132 | + dst | ||
| 133 | + }, | ||
| 134 | + ); | ||
| 135 | +} | ||
| 136 | + | ||
| 137 | +fn main() { | ||
| 138 | + benchlib::benchmark::run_global_benchmark_group(); | ||
| 139 | +} | ||
| @@ -0,0 +1,455 @@ | |||
| 1 | +# This file is automatically @generated by Cargo. | ||
| 2 | +# It is not intended for manual editing. | ||
| 3 | +version = 4 | ||
| 4 | + | ||
| 5 | +[[package]] | ||
| 6 | +name = "aho-corasick" | ||
| 7 | +version = "1.1.4" | ||
| 8 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 9 | +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" | ||
| 10 | +dependencies = [ | ||
| 11 | + "memchr", | ||
| 12 | +] | ||
| 13 | + | ||
| 14 | +[[package]] | ||
| 15 | +name = "anstream" | ||
| 16 | +version = "1.0.0" | ||
| 17 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 18 | +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" | ||
| 19 | +dependencies = [ | ||
| 20 | + "anstyle", | ||
| 21 | + "anstyle-parse", | ||
| 22 | + "anstyle-query", | ||
| 23 | + "anstyle-wincon", | ||
| 24 | + "colorchoice", | ||
| 25 | + "is_terminal_polyfill", | ||
| 26 | + "utf8parse", | ||
| 27 | +] | ||
| 28 | + | ||
| 29 | +[[package]] | ||
| 30 | +name = "anstyle" | ||
| 31 | +version = "1.0.14" | ||
| 32 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 33 | +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" | ||
| 34 | + | ||
| 35 | +[[package]] | ||
| 36 | +name = "anstyle-parse" | ||
| 37 | +version = "1.0.0" | ||
| 38 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 39 | +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" | ||
| 40 | +dependencies = [ | ||
| 41 | + "utf8parse", | ||
| 42 | +] | ||
| 43 | + | ||
| 44 | +[[package]] | ||
| 45 | +name = "anstyle-query" | ||
| 46 | +version = "1.1.5" | ||
| 47 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 48 | +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" | ||
| 49 | +dependencies = [ | ||
| 50 | + "windows-sys", | ||
| 51 | +] | ||
| 52 | + | ||
| 53 | +[[package]] | ||
| 54 | +name = "anstyle-wincon" | ||
| 55 | +version = "3.0.11" | ||
| 56 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 57 | +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" | ||
| 58 | +dependencies = [ | ||
| 59 | + "anstyle", | ||
| 60 | + "once_cell_polyfill", | ||
| 61 | + "windows-sys", | ||
| 62 | +] | ||
| 63 | + | ||
| 64 | +[[package]] | ||
| 65 | +name = "anyhow" | ||
| 66 | +version = "1.0.102" | ||
| 67 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 68 | +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" | ||
| 69 | + | ||
| 70 | +[[package]] | ||
| 71 | +name = "bench-map-regular" | ||
| 72 | +version = "0.1.0" | ||
| 73 | +dependencies = [ | ||
| 74 | + "benchlib", | ||
| 75 | + "rustc_version", | ||
| 76 | +] | ||
| 77 | + | ||
| 78 | +[[package]] | ||
| 79 | +name = "benchlib" | ||
| 80 | +version = "0.1.0" | ||
| 81 | +dependencies = [ | ||
| 82 | + "anyhow", | ||
| 83 | + "benchlib-macros", | ||
| 84 | + "clap", | ||
| 85 | + "ctor", | ||
| 86 | + "env_logger", | ||
| 87 | + "libc", | ||
| 88 | + "log", | ||
| 89 | + "perf-event", | ||
| 90 | + "serde", | ||
| 91 | + "serde_json", | ||
| 92 | +] | ||
| 93 | + | ||
| 94 | +[[package]] | ||
| 95 | +name = "benchlib-macros" | ||
| 96 | +version = "0.1.0" | ||
| 97 | +dependencies = [ | ||
| 98 | + "proc-macro2", | ||
| 99 | + "quote", | ||
| 100 | + "syn", | ||
| 101 | +] | ||
| 102 | + | ||
| 103 | +[[package]] | ||
| 104 | +name = "bitflags" | ||
| 105 | +version = "2.13.0" | ||
| 106 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 107 | +checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" | ||
| 108 | + | ||
| 109 | +[[package]] | ||
| 110 | +name = "clap" | ||
| 111 | +version = "4.6.1" | ||
| 112 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 113 | +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" | ||
| 114 | +dependencies = [ | ||
| 115 | + "clap_builder", | ||
| 116 | + "clap_derive", | ||
| 117 | +] | ||
| 118 | + | ||
| 119 | +[[package]] | ||
| 120 | +name = "clap_builder" | ||
| 121 | +version = "4.6.0" | ||
| 122 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 123 | +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" | ||
| 124 | +dependencies = [ | ||
| 125 | + "anstream", | ||
| 126 | + "anstyle", | ||
| 127 | + "clap_lex", | ||
| 128 | + "strsim", | ||
| 129 | +] | ||
| 130 | + | ||
| 131 | +[[package]] | ||
| 132 | +name = "clap_derive" | ||
| 133 | +version = "4.6.1" | ||
| 134 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 135 | +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" | ||
| 136 | +dependencies = [ | ||
| 137 | + "heck", | ||
| 138 | + "proc-macro2", | ||
| 139 | + "quote", | ||
| 140 | + "syn", | ||
| 141 | +] | ||
| 142 | + | ||
| 143 | +[[package]] | ||
| 144 | +name = "clap_lex" | ||
| 145 | +version = "1.1.0" | ||
| 146 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 147 | +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" | ||
| 148 | + | ||
| 149 | +[[package]] | ||
| 150 | +name = "colorchoice" | ||
| 151 | +version = "1.0.5" | ||
| 152 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 153 | +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" | ||
| 154 | + | ||
| 155 | +[[package]] | ||
| 156 | +name = "ctor" | ||
| 157 | +version = "0.6.3" | ||
| 158 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 159 | +checksum = "424e0138278faeb2b401f174ad17e715c829512d74f3d1e81eb43365c2e0590e" | ||
| 160 | +dependencies = [ | ||
| 161 | + "ctor-proc-macro", | ||
| 162 | + "dtor", | ||
| 163 | +] | ||
| 164 | + | ||
| 165 | +[[package]] | ||
| 166 | +name = "ctor-proc-macro" | ||
| 167 | +version = "0.0.7" | ||
| 168 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 169 | +checksum = "52560adf09603e58c9a7ee1fe1dcb95a16927b17c127f0ac02d6e768a0e25bc1" | ||
| 170 | + | ||
| 171 | +[[package]] | ||
| 172 | +name = "dtor" | ||
| 173 | +version = "0.1.1" | ||
| 174 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 175 | +checksum = "404d02eeb088a82cfd873006cb713fe411306c7d182c344905e101fb1167d301" | ||
| 176 | +dependencies = [ | ||
| 177 | + "dtor-proc-macro", | ||
| 178 | +] | ||
| 179 | + | ||
| 180 | +[[package]] | ||
| 181 | +name = "dtor-proc-macro" | ||
| 182 | +version = "0.0.6" | ||
| 183 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 184 | +checksum = "f678cf4a922c215c63e0de95eb1ff08a958a81d47e485cf9da1e27bf6305cfa5" | ||
| 185 | + | ||
| 186 | +[[package]] | ||
| 187 | +name = "env_logger" | ||
| 188 | +version = "0.10.2" | ||
| 189 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 190 | +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" | ||
| 191 | +dependencies = [ | ||
| 192 | + "humantime", | ||
| 193 | + "is-terminal", | ||
| 194 | + "log", | ||
| 195 | + "regex", | ||
| 196 | + "termcolor", | ||
| 197 | +] | ||
| 198 | + | ||
| 199 | +[[package]] | ||
| 200 | +name = "heck" | ||
| 201 | +version = "0.5.0" | ||
| 202 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 203 | +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" | ||
| 204 | + | ||
| 205 | +[[package]] | ||
| 206 | +name = "hermit-abi" | ||
| 207 | +version = "0.5.2" | ||
| 208 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 209 | +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" | ||
| 210 | + | ||
| 211 | +[[package]] | ||
| 212 | +name = "humantime" | ||
| 213 | +version = "2.3.0" | ||
| 214 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 215 | +checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" | ||
| 216 | + | ||
| 217 | +[[package]] | ||
| 218 | +name = "is-terminal" | ||
| 219 | +version = "0.4.17" | ||
| 220 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 221 | +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" | ||
| 222 | +dependencies = [ | ||
| 223 | + "hermit-abi", | ||
| 224 | + "libc", | ||
| 225 | + "windows-sys", | ||
| 226 | +] | ||
| 227 | + | ||
| 228 | +[[package]] | ||
| 229 | +name = "is_terminal_polyfill" | ||
| 230 | +version = "1.70.2" | ||
| 231 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 232 | +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" | ||
| 233 | + | ||
| 234 | +[[package]] | ||
| 235 | +name = "itoa" | ||
| 236 | +version = "1.0.18" | ||
| 237 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 238 | +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" | ||
| 239 | + | ||
| 240 | +[[package]] | ||
| 241 | +name = "libc" | ||
| 242 | +version = "0.2.186" | ||
| 243 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 244 | +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" | ||
| 245 | + | ||
| 246 | +[[package]] | ||
| 247 | +name = "log" | ||
| 248 | +version = "0.4.32" | ||
| 249 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 250 | +checksum = "953f07c43838f8e6f9758cab68bf5bed85465e7587ebe0b823f1bcd81978ad3a" | ||
| 251 | + | ||
| 252 | +[[package]] | ||
| 253 | +name = "memchr" | ||
| 254 | +version = "2.8.1" | ||
| 255 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 256 | +checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8" | ||
| 257 | + | ||
| 258 | +[[package]] | ||
| 259 | +name = "once_cell_polyfill" | ||
| 260 | +version = "1.70.2" | ||
| 261 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 262 | +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" | ||
| 263 | + | ||
| 264 | +[[package]] | ||
| 265 | +name = "perf-event" | ||
| 266 | +version = "0.4.9" | ||
| 267 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 268 | +checksum = "c2529f39584dbaa980f4959510c963ae95f119c127c046012c2834365f694438" | ||
| 269 | +dependencies = [ | ||
| 270 | + "bitflags", | ||
| 271 | + "libc", | ||
| 272 | + "perf-event-open-sys", | ||
| 273 | +] | ||
| 274 | + | ||
| 275 | +[[package]] | ||
| 276 | +name = "perf-event-open-sys" | ||
| 277 | +version = "6.0.0" | ||
| 278 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 279 | +checksum = "a5f8d1487a4ffa23c80a1c355dd27235f9b66fb71ba0f261eb417e4fe8451347" | ||
| 280 | +dependencies = [ | ||
| 281 | + "libc", | ||
| 282 | +] | ||
| 283 | + | ||
| 284 | +[[package]] | ||
| 285 | +name = "proc-macro2" | ||
| 286 | +version = "1.0.106" | ||
| 287 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 288 | +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" | ||
| 289 | +dependencies = [ | ||
| 290 | + "unicode-ident", | ||
| 291 | +] | ||
| 292 | + | ||
| 293 | +[[package]] | ||
| 294 | +name = "quote" | ||
| 295 | +version = "1.0.45" | ||
| 296 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 297 | +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" | ||
| 298 | +dependencies = [ | ||
| 299 | + "proc-macro2", | ||
| 300 | +] | ||
| 301 | + | ||
| 302 | +[[package]] | ||
| 303 | +name = "regex" | ||
| 304 | +version = "1.12.3" | ||
| 305 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 306 | +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" | ||
| 307 | +dependencies = [ | ||
| 308 | + "aho-corasick", | ||
| 309 | + "memchr", | ||
| 310 | + "regex-automata", | ||
| 311 | + "regex-syntax", | ||
| 312 | +] | ||
| 313 | + | ||
| 314 | +[[package]] | ||
| 315 | +name = "regex-automata" | ||
| 316 | +version = "0.4.14" | ||
| 317 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 318 | +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" | ||
| 319 | +dependencies = [ | ||
| 320 | + "aho-corasick", | ||
| 321 | + "memchr", | ||
| 322 | + "regex-syntax", | ||
| 323 | +] | ||
| 324 | + | ||
| 325 | +[[package]] | ||
| 326 | +name = "regex-syntax" | ||
| 327 | +version = "0.8.10" | ||
| 328 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 329 | +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" | ||
| 330 | + | ||
| 331 | +[[package]] | ||
| 332 | +name = "rustc_version" | ||
| 333 | +version = "0.4.1" | ||
| 334 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 335 | +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" | ||
| 336 | +dependencies = [ | ||
| 337 | + "semver", | ||
| 338 | +] | ||
| 339 | + | ||
| 340 | +[[package]] | ||
| 341 | +name = "semver" | ||
| 342 | +version = "1.0.28" | ||
| 343 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 344 | +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" | ||
| 345 | + | ||
| 346 | +[[package]] | ||
| 347 | +name = "serde" | ||
| 348 | +version = "1.0.228" | ||
| 349 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 350 | +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" | ||
| 351 | +dependencies = [ | ||
| 352 | + "serde_core", | ||
| 353 | + "serde_derive", | ||
| 354 | +] | ||
| 355 | + | ||
| 356 | +[[package]] | ||
| 357 | +name = "serde_core" | ||
| 358 | +version = "1.0.228" | ||
| 359 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 360 | +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" | ||
| 361 | +dependencies = [ | ||
| 362 | + "serde_derive", | ||
| 363 | +] | ||
| 364 | + | ||
| 365 | +[[package]] | ||
| 366 | +name = "serde_derive" | ||
| 367 | +version = "1.0.228" | ||
| 368 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 369 | +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" | ||
| 370 | +dependencies = [ | ||
| 371 | + "proc-macro2", | ||
| 372 | + "quote", | ||
| 373 | + "syn", | ||
| 374 | +] | ||
| 375 | + | ||
| 376 | +[[package]] | ||
| 377 | +name = "serde_json" | ||
| 378 | +version = "1.0.150" | ||
| 379 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 380 | +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" | ||
| 381 | +dependencies = [ | ||
| 382 | + "itoa", | ||
| 383 | + "memchr", | ||
| 384 | + "serde", | ||
| 385 | + "serde_core", | ||
| 386 | + "zmij", | ||
| 387 | +] | ||
| 388 | + | ||
| 389 | +[[package]] | ||
| 390 | +name = "strsim" | ||
| 391 | +version = "0.11.1" | ||
| 392 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 393 | +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" | ||
| 394 | + | ||
| 395 | +[[package]] | ||
| 396 | +name = "syn" | ||
| 397 | +version = "2.0.117" | ||
| 398 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 399 | +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" | ||
| 400 | +dependencies = [ | ||
| 401 | + "proc-macro2", | ||
| 402 | + "quote", | ||
| 403 | + "unicode-ident", | ||
| 404 | +] | ||
| 405 | + | ||
| 406 | +[[package]] | ||
| 407 | +name = "termcolor" | ||
| 408 | +version = "1.4.1" | ||
| 409 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 410 | +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" | ||
| 411 | +dependencies = [ | ||
| 412 | + "winapi-util", | ||
| 413 | +] | ||
| 414 | + | ||
| 415 | +[[package]] | ||
| 416 | +name = "unicode-ident" | ||
| 417 | +version = "1.0.24" | ||
| 418 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 419 | +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" | ||
| 420 | + | ||
| 421 | +[[package]] | ||
| 422 | +name = "utf8parse" | ||
| 423 | +version = "0.2.2" | ||
| 424 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 425 | +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" | ||
| 426 | + | ||
| 427 | +[[package]] | ||
| 428 | +name = "winapi-util" | ||
| 429 | +version = "0.1.11" | ||
| 430 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 431 | +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" | ||
| 432 | +dependencies = [ | ||
| 433 | + "windows-sys", | ||
| 434 | +] | ||
| 435 | + | ||
| 436 | +[[package]] | ||
| 437 | +name = "windows-link" | ||
| 438 | +version = "0.2.1" | ||
| 439 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 440 | +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" | ||
| 441 | + | ||
| 442 | +[[package]] | ||
| 443 | +name = "windows-sys" | ||
| 444 | +version = "0.61.2" | ||
| 445 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 446 | +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" | ||
| 447 | +dependencies = [ | ||
| 448 | + "windows-link", | ||
| 449 | +] | ||
| 450 | + | ||
| 451 | +[[package]] | ||
| 452 | +name = "zmij" | ||
| 453 | +version = "1.0.21" | ||
| 454 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 455 | +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" | ||
| @@ -0,0 +1,12 @@ | |||
| 1 | +[package] | ||
| 2 | +name = "bench-map-regular" | ||
| 3 | +version = "0.1.0" | ||
| 4 | +edition = "2021" | ||
| 5 | + | ||
| 6 | +[dependencies] | ||
| 7 | +benchlib = { path = "../../benchlib" } | ||
| 8 | + | ||
| 9 | +[build-dependencies] | ||
| 10 | +rustc_version = "0.4" | ||
| 11 | + | ||
| 12 | +[workspace] | ||
| @@ -0,0 +1,6 @@ | |||
| 1 | +fn main() { | ||
| 2 | + println!("cargo:rustc-check-cfg=cfg(nightly)"); | ||
| 3 | + if matches!(rustc_version::version_meta().unwrap().channel, rustc_version::Channel::Nightly | rustc_version::Channel::Dev) { | ||
| 4 | + println!("cargo:rustc-cfg=nightly"); | ||
| 5 | + } | ||
| 6 | +} | ||
| @@ -0,0 +1,32 @@ | |||
| 1 | +[root@localhost rust-bench]# ./target/release/collector bench_runtime_local +nightly --group bench_map_regular | ||
| 2 | +Using database `results.db` | ||
| 3 | +Compiling 1 runtime benchmark group(s) | ||
| 4 | +Compiling `bench_map_regular` (1/1) | ||
| 5 | +Executing 3 benchmarks | ||
| 6 | + | ||
| 7 | +Finished bench_map_regular/bench_map_regular::bench_map_regular (1/3) | ||
| 8 | + [Instructions]: min: 35,171 mean: 35,216 stddev: 37 | ||
| 9 | + [Cycles]: min: 7,902 mean: 7,961 stddev: 57 | ||
| 10 | + [Wall time [ns]]: min: 2,690 mean: 2,760 stddev: 46 | ||
| 11 | + [Branch misses]: min: 5 mean: 6 stddev: 1 | ||
| 12 | + [Cache misses]: min: 56 mean: 58 stddev: 2 | ||
| 13 | +[Cache references]: min: 16,478 mean: 16,495 stddev: 17 | ||
| 14 | + [Memory [kb]]: Not available | ||
| 15 | + | ||
| 16 | +Finished bench_map_regular/bench_map_regular::bench_map_regular_neon (2/3) | ||
| 17 | + [Instructions]: min: 20,910 mean: 20,910 stddev: 0 | ||
| 18 | + [Cycles]: min: 6,711 mean: 6,763 stddev: 40 | ||
| 19 | + [Wall time [ns]]: min: 2,200 mean: 2,200 stddev: 0 | ||
| 20 | + [Branch misses]: min: 4 mean: 5 stddev: 1 | ||
| 21 | + [Cache misses]: min: 59 mean: 62 stddev: 2 | ||
| 22 | +[Cache references]: min: 8,313 mean: 8,324 stddev: 9 | ||
| 23 | + [Memory [kb]]: Not available | ||
| 24 | + | ||
| 25 | +Finished bench_map_regular/bench_map_regular::bench_map_regular_sve (3/3) | ||
| 26 | + [Instructions]: min: 18,875 mean: 18,875 stddev: 0 | ||
| 27 | + [Cycles]: min: 4,592 mean: 4,738 stddev: 85 | ||
| 28 | + [Wall time [ns]]: min: 1,470 mean: 1,492 stddev: 20 | ||
| 29 | + [Branch misses]: min: 3 mean: 5 stddev: 1 | ||
| 30 | + [Cache misses]: min: 132 mean: 146 stddev: 8 | ||
| 31 | +[Cache references]: min: 8,318 mean: 8,324 stddev: 3 | ||
| 32 | + [Memory [kb]]: Not available | ||
| @@ -0,0 +1,102 @@ | |||
| 1 | + | ||
| 2 | + | ||
| 3 | +use benchlib::benchmark::{bench, black_box, Bencher}; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +const LEN: usize = 4096; | ||
| 7 | + | ||
| 8 | + | ||
| 9 | +const LEN: usize = 16384; | ||
| 10 | + | ||
| 11 | + | ||
| 12 | +fn bench_map_regular(b: &mut Bencher) { | ||
| 13 | + let data = black_box([(0u32, 0u32); LEN]); | ||
| 14 | + b.iter( | ||
| 15 | + || {}, | ||
| 16 | + |_| { | ||
| 17 | + let mut v = Vec::<u32>::new(); | ||
| 18 | + v.extend(data.iter().map(|t| t.1)); | ||
| 19 | + v | ||
| 20 | + }, | ||
| 21 | + ); | ||
| 22 | +} | ||
| 23 | + | ||
| 24 | + | ||
| 25 | +use std::arch::aarch64::*; | ||
| 26 | + | ||
| 27 | + | ||
| 28 | +unsafe fn map_extract_second_neon(data: &[(u32, u32)]) -> Vec<u32> { | ||
| 29 | + let len = data.len(); | ||
| 30 | + let mut result: Vec<u32> = Vec::with_capacity(len); | ||
| 31 | + let dst_ptr = result.as_mut_ptr(); | ||
| 32 | + let src_ptr = data.as_ptr() as *const u32; | ||
| 33 | + | ||
| 34 | + let mut i = 0usize; | ||
| 35 | + while i + 4 <= len { | ||
| 36 | + // vld2q loads 8 u32s and deinterleaves into two registers | ||
| 37 | + let pair = vld2q_u32(src_ptr.add(i * 2)); | ||
| 38 | + // pair.1 contains the second element of each pair | ||
| 39 | + vst1q_u32(dst_ptr.add(i), pair.1); | ||
| 40 | + i += 4; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + while i < len { | ||
| 44 | + *dst_ptr.add(i) = data[i].1; | ||
| 45 | + i += 1; | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + result.set_len(len); | ||
| 49 | + result | ||
| 50 | +} | ||
| 51 | + | ||
| 52 | + | ||
| 53 | +fn bench_map_regular_neon(b: &mut Bencher) { | ||
| 54 | + let data = black_box([(0u32, 0u32); LEN]); | ||
| 55 | + b.iter( | ||
| 56 | + || {}, | ||
| 57 | + |_| unsafe { map_extract_second_neon(&data) }, | ||
| 58 | + ); | ||
| 59 | +} | ||
| 60 | + | ||
| 61 | + | ||
| 62 | + | ||
| 63 | +unsafe fn map_extract_second_sve(data: &[(u32, u32)]) -> Vec<u32> { | ||
| 64 | + let len = data.len() as u64; | ||
| 65 | + let mut result: Vec<u32> = Vec::with_capacity(len as usize); | ||
| 66 | + let dst_ptr = result.as_mut_ptr(); | ||
| 67 | + let src_ptr = data.as_ptr() as *const u32; | ||
| 68 | + let vl = svcntw(); | ||
| 69 | + | ||
| 70 | + let mut i = 0u64; | ||
| 71 | + | ||
| 72 | + while i < len { | ||
| 73 | + let pg = svwhilelt_b32_u64(i, len); | ||
| 74 | + | ||
| 75 | + // Load two vectors covering 2*vl u32 values (vl pairs) | ||
| 76 | + let v0 = svld1_u32(pg, src_ptr.add((i * 2) as usize)); | ||
| 77 | + let v1 = svld1_u32(pg, src_ptr.add((i * 2 + vl) as usize)); | ||
| 78 | + | ||
| 79 | + // svuzp2 extracts odd-indexed elements (the second of each pair) | ||
| 80 | + let seconds = svuzp2_u32(v0, v1); | ||
| 81 | + | ||
| 82 | + svst1_u32(pg, dst_ptr.add(i as usize), seconds); | ||
| 83 | + | ||
| 84 | + i += vl; | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + result.set_len(len as usize); | ||
| 88 | + result | ||
| 89 | +} | ||
| 90 | + | ||
| 91 | + | ||
| 92 | +fn bench_map_regular_sve(b: &mut Bencher) { | ||
| 93 | + let data = black_box([(0u32, 0u32); LEN]); | ||
| 94 | + b.iter( | ||
| 95 | + || {}, | ||
| 96 | + |_| unsafe { map_extract_second_sve(&data) }, | ||
| 97 | + ); | ||
| 98 | +} | ||
| 99 | + | ||
| 100 | +fn main() { | ||
| 101 | + benchlib::benchmark::run_global_benchmark_group(); | ||
| 102 | +} | ||