Sha256: 0beff8b073ce4f71ce963fb527429c93ec5fb9cb39bf872f4a9c93b303097af5
Contents?: true
Size: 358 Bytes
Versions: 109
Compression:
Stored size: 358 Bytes
Contents
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
Version data entries
109 entries across 89 versions & 10 rubygems