-
-
Save MattOates/0c051cb36d152bd20f1e23a42ef96b78 to your computer and use it in GitHub Desktop.
Raw IO comparison P6 v P5
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
Use a common byte number you see in the wild | |
$ time perl6 -e 'while ( my $buf = $*IN.read(1024) ) {}' < gigabyteish_file | |
real 0m17.256s | |
user 0m16.393s | |
sys 0m0.481s | |
$ time perl -e 'while ( read(STDIN,$buf,1024) ) {}' < gigabyteish_file | |
real 0m0.481s | |
user 0m0.189s | |
sys 0m0.281s | |
Use the doc'd P6 default | |
$ time perl6 -e 'while (my $buf = $*IN.read(65536)) {}' < gigabyteish_file | |
real 0m2.413s | |
user 0m1.200s | |
sys 0m1.099s | |
$ time perl -e 'while(read(STDIN,$buf,65536)) {}' < English_Office_2011_Mac_SP1_X17-45975.img | |
real 0m0.376s | |
user 0m0.069s | |
sys 0m0.295s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment