Skip to content

Instantly share code, notes, and snippets.

@cheald

cheald/oom.rb Secret

Created November 13, 2014 06:27
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 cheald/c023a33590579d3ed78b to your computer and use it in GitHub Desktop.
Save cheald/c023a33590579d3ed78b to your computer and use it in GitHub Desktop.
require 'benchmark'
Benchmark.bm do |x|
x.report("regexp creation") do
count = 0
big_scary_string = "bigstring" * 500
1000.times do |i|
i.times do |j|
Regexp.new("test#{i}_#{j}")
Regexp.new("test#{i * j}")
end
print "."
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment