Skip to content

Instantly share code, notes, and snippets.

@MattOates
Last active June 30, 2017 10:30
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 MattOates/0c051cb36d152bd20f1e23a42ef96b78 to your computer and use it in GitHub Desktop.
Save MattOates/0c051cb36d152bd20f1e23a42ef96b78 to your computer and use it in GitHub Desktop.
Raw IO comparison P6 v P5
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