Sha256: ea3308251fb2411796050d124765087f90f25f2c5ffb676e725a0da2caed1d3e

Contents?: true

Size: 377 Bytes

Versions: 1

Compression:

Stored size: 377 Bytes

Contents

# frozen_string_literal: true

require 'benchmark'

NAMES_COUNT = 10_000

def run(name)
  Benchmark.bm do |rep|
    rep.report("generating #{NAMES_COUNT} names (#{name})") do
      mod == 'ffaker' ? FFaker : Faker
      NAMES_COUNT.times { mod::Name.name }
    end
  end
end

['faker', 'ffaker'].each do |gem_name|
  require gem_name
  fork { run(gem_name) }; Process.wait
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ffaker-2.14.0 scripts/benchmark.rb