Skip to content

Instantly share code, notes, and snippets.

@t3hk0d3
Created April 26, 2016 18:34
Show Gist options
  • Save t3hk0d3/51327a53beeca79d813b08db374092a4 to your computer and use it in GitHub Desktop.
Save t3hk0d3/51327a53beeca79d813b08db374092a4 to your computer and use it in GitHub Desktop.
lazy = config_file.lazy
Benchmark.bm do |x|
x.report("online") { 100000.times { config_files.map { |f| File.mtime(f).to_i }.max } }
x.report("lazy") { 100000.times { lazy.map { |f| File.mtime(f).to_i }.max } }
end
user system total real
online 0.580000 0.450000 1.030000 ( 1.043045)
lazy 1.450000 0.490000 1.940000 ( 1.936203)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment