Last active
May 6, 2019 15:46
-
-
Save EvanCarroll/8554456 to your computer and use it in GitHub Desktop.
Perl sux.
This file contains hidden or 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
#!/usr/bin/env perl | |
use Benchmark qw(:all); | |
use strict; | |
use warnings; | |
use constant STUFF => ( qw/ | |
TRO BAR OLOL JAZ | |
TRO BAR OLOL JAZ | |
/ ); | |
cmpthese( 1E6, { | |
insane => sub { call_insane(STUFF); call_insane(STUFF); } | |
, sane_saved => sub { my $args = {STUFF}; call_sane($args); call_sane($args); } | |
, sane_wash => sub { call_sane({STUFF}); call_sane({STUFF}); } | |
} | |
); | |
sub call_insane { my %args = @_; } | |
sub call_sane { my $args = $_[0]; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment