Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created April 7, 2019 01:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Whateverable/ff2e793f3ae398da1ea6dbfd109b2dac to your computer and use it in GitHub Desktop.
Save Whateverable/ff2e793f3ae398da1ea6dbfd109b2dac to your computer and use it in GitHub Desktop.
benchable6
compare HEAD my @a = <a b c>; my @b; for ^100_000 { @b = @a.clone.push("d"); }; dd @b ||| my @a = <a b c>; my @b; for ^100_000 { @b = |@a, "d"; }; dd @b
¦HEAD: «Benchmark:
Array @b = ["a", "b", "c", "d"]
Timing 10 iterations of 0, 1...
0: 1.5885 wallclock secs @ 6.2954/s (n=10)
1: 9.4179 wallclock secs @ 1.0618/s (n=10)
O---O--------O------O------O
| | Rate | 1 | 0 |
O===O========O======O======O
| 1 | 1.06/s | -- | -83% |
| 0 | 6.30/s | 493% | -- |
----------------------------
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
Array @b = ["a", "b", "c", "d"]
»
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment