-
-
Save thibaultduponchelle/e59322a0b01bfa31d66ef602a5d1f649 to your computer and use it in GitHub Desktop.
Terrible unshift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Performs VERY well | |
my int @a = (); | |
for (1..4000000) -> int $item { | |
@a.push($item); | |
} | |
# Performs VERY bad | |
my int @a = (); | |
for (1..1000000) -> int $item { | |
@a.unshift($item); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment