Skip to content

Instantly share code, notes, and snippets.

@sachin21
Created April 15, 2017 11:21
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 sachin21/df288d8f36b75356175bee5332c93643 to your computer and use it in GitHub Desktop.
Save sachin21/df288d8f36b75356175bee5332c93643 to your computer and use it in GitHub Desktop.
Faker VS FFaker benchmarks
require 'benchmark/ips'
require 'faker'
require 'ffaker'
Benchmark.ips do |x|
x.report('faker') { Faker::Name.name }
x.report('ffaker') { FFaker::Name.name }
x.compare!
end
Warming up --------------------------------------
faker 1.590k i/100ms
ffaker 42.837k i/100ms
Calculating -------------------------------------
faker 18.691k (± 5.6%) i/s - 93.810k in 5.036465s
ffaker 523.357k (± 6.2%) i/s - 2.613M in 5.017709s
Comparison:
ffaker: 523357.4 i/s
faker: 18691.2 i/s - 28.00x slower
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment