fastruby / fast-ruby

:dash: Writing Fast Ruby :heart_eyes: -- Collect Common Ruby idioms.
https://github.com/fastruby/fast-ruby
5.67k stars 376 forks source link

Update all examples and results for fast comes first #27

Open JuanitoFatas opened 9 years ago

JuanitoFatas commented 9 years ago

Update template:

require 'benchmark/ips'

def fast
end

def slow
end

Benchmark.ips do |x|
  x.report('fast') { fast }
  x.report('slow') { slow }
  x.compare!
end

and reorganize all stuff according to :point_up_2: :point_up_2: :point_up_2:

Since x.compare! will show fast then slow, this may have a better reading experience when reading README IMO. Also document in CONTRIBUTING.md to give people notice when submits a new entry.

mateusdeap commented 2 years ago

I'll be taking this