Sha256: cc119dec0e44dd2bb6d519dfc06463cb9b91143a24a6eb7387f959e37d2f33b1
Contents?: true
Size: 391 Bytes
Versions: 43
Compression:
Stored size: 391 Bytes
Contents
# frozen_string_literal: true 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
43 entries across 42 versions & 7 rubygems