Last active
March 19, 2017 23:16
-
-
Save zoffixznet/77219bc00ebd594417f07e32e0d898bc to your computer and use it in GitHub Desktop.
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
for i in {1,10000000,20000000,300000000,600000000,1000000000}; do dd of=file bs=1 seek=$i count=0 &>/dev/null; perl6 -e 'my $i = '$i'/1000_000; with qx|/usr/bin/time perl6 -e '\''"file".IO.slurp'\'' 2>&1|.lines.head.words.tail.comb(/\d+/).head.&[~]("000") {"mark".IO.e ?? "{$i}MB file slurp uses: {($_ - "mark".IO.slurp)/1000_000}MB [{($_ - "mark".IO.slurp)/1000_000/$i}x data use]".say !! ("mark".IO.spurt($_), "\n\nZero file RES use: {$_/1000_000}MB; saving it as mark to subtract from further measurements".say) }'; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment