Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Last active March 19, 2017 23:16
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 zoffixznet/77219bc00ebd594417f07e32e0d898bc to your computer and use it in GitHub Desktop.
Save zoffixznet/77219bc00ebd594417f07e32e0d898bc to your computer and use it in GitHub Desktop.
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