Skip to content

Instantly share code, notes, and snippets.

View bheeshmar's full-sized avatar

Bheeshmar Redheendran bheeshmar

View GitHub Profile
@bheeshmar
bheeshmar / grep_bench.rb
Created April 9, 2011 22:10
Benchmarking various ways to grep recursively
require 'benchmark'
Benchmark.bm(15) do |test|
test.report('grep-recursive') do
system('grep -r --include="*.h" -l include /usr/src/linux-headers-2.6.32-30/ > /dev/null')
end
test.report('grep-find') do
system('grep -l include $(find /usr/src/linux-headers-2.6.32-30/ -name "*.h" -print) > /dev/null')
end