Skip to content

Instantly share code, notes, and snippets.

@troter
Created April 2, 2014 02:43
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 troter/9927116 to your computer and use it in GitHub Desktop.
Save troter/9927116 to your computer and use it in GitHub Desktop.
いろいろ手直しした結果、'hg locate + grep'より'hg grepfile'の方が早くなったっぽい。 https://bitbucket.org/troter/hg-grepfile
# OS X 10.9.2
# CPU 2.3 GHz Intel Core i7
# MEM 16GB 1600 MHz DDR3
% hg clone http://selenic.com/hg
% cd hg
# hg locate + grep
% for i in $(seq 3); do time (hg locate | xargs grep -n -i ctx.walk > /dev/null) ; done
( hg locate | xargs grep -n -i ctx.walk > /dev/null; ) 0.73s user 0.06s system 97% cpu 0.807 total
( hg locate | xargs grep -n -i ctx.walk > /dev/null; ) 0.76s user 0.06s system 95% cpu 0.857 total
( hg locate | xargs grep -n -i ctx.walk > /dev/null; ) 0.72s user 0.06s system 99% cpu 0.779 total
# hg grepfile # https://bitbucket.org/troter/hg-grepfile rev f149968a347391cd3bd12b7829a6fe0c9fa6ff91(old version)
% for i in $(seq 3); do time (hg grepfile -n -i ctx.walk > /dev/null) ; done
( hg grepfile -n -i ctx.walk > /dev/null; ) 0.71s user 0.08s system 99% cpu 0.792 total
( hg grepfile -n -i ctx.walk > /dev/null; ) 0.77s user 0.09s system 99% cpu 0.863 total
( hg grepfile -n -i ctx.walk > /dev/null; ) 0.75s user 0.09s system 99% cpu 0.848 total
# hg grepfile # https://bitbucket.org/troter/hg-grepfile rev 57a3fddd0c63f9378617ee6d387a0b58414a22c7
% for i in $(seq 3); do time (hg grepfile -n -i ctx.walk > /dev/null) ; done
( hg grepfile -n -i ctx.walk > /dev/null; ) 0.41s user 0.07s system 99% cpu 0.486 total
( hg grepfile -n -i ctx.walk > /dev/null; ) 0.39s user 0.07s system 98% cpu 0.465 total
( hg grepfile -n -i ctx.walk > /dev/null; ) 0.38s user 0.06s system 99% cpu 0.450 total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment