Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

12 lines (10 sloc) 0.358 kB
require "benchmark"
# To prove that flattening a small list is not significantly slower than
# calling *list (used to get around create_tag list issue)
$a = "FOO BAR BAZ"
def foo(*args) args.last.inspect end
TESTS = 10_000
Benchmark.bmbm do |x|
x.report("splat") { TESTS.times { foo *$a } }
x.report("flatten") { TESTS.times { foo *[$a].flatten } }
end
Jump to Line
Something went wrong with that request. Please try again.