diff options
| author | Jack Nagel | 2013-04-14 18:20:09 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-04-14 18:32:48 -0500 |
| commit | 04b400ef9a0837806680b04f9d5924101c680371 (patch) | |
| tree | 54cf1d134ae40ee146bd4f31571c5314096faa30 /Library/Formula/plotutils.rb | |
| parent | 90b70fd8a111afe450b5f9ec74b997a5efa0586d (diff) | |
| download | homebrew-04b400ef9a0837806680b04f9d5924101c680371.tar.bz2 | |
Optimization: avoid repeated interpolation in regexp
Benchmark.bm do |b|
b.report("before") do
100_000.times { /(\.#{MacOS.cat}\.bottle\.(\d+\.)?tar\.gz)$/ }
end
b.report("after ") do
100_000.times { /(\.#{MacOS.cat}\.bottle\.(\d+\.)?tar\.gz)$/o }
end
end
user system total real
before 35.400000 0.140000 35.540000 ( 35.619674)
after 0.020000 0.000000 0.020000 ( 0.016662)
Diffstat (limited to 'Library/Formula/plotutils.rb')
0 files changed, 0 insertions, 0 deletions
