e1a7260640
```ruby require 'benchmark/ips' Benchmark.ips do |x| x.report("$&") { "foo".sub(/f/) { $&.upcase } } x.report("block var") { "foo".sub(/f/) {|match| match.upcase } } end ``` ``` Calculating ------------------------------------- $& 48.658k i/100ms block var 49.666k i/100ms ------------------------------------------------- $& 873.156k (± 9.3%) i/s - 4.331M block var 969.744k (± 9.2%) i/s - 4.818M ``` It's faster, and gets rid of a few "magic" global variables |
||
---|---|---|
.. | ||
README.md | ||
console | ||
line_statistics | ||
profile |
README.md
Rails dev tools
This is a collection of utilities used for Rails internal development. They aren't used by Rails apps directly.
console
drops you in irb and loads local Rails reposprofile
profilesKernel#require
to help reduce startup time