Created
October 30, 2016 02:48
-
-
Save pocke/4a9f3ea672de9366992cd881f52b432b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'benchmark' | |
| Benchmark.bm 10 do |x| | |
| x.report('=~'){ 10000000.times{/a/ =~ 'a'; /b/ =~ 'a' }} | |
| x.report('==='){ 10000000.times{/a/ === 'a'; /b/ === 'a' }} | |
| x.report('match'){ 10000000.times{/a/.match('a'); /b/.match('a') }} | |
| x.report('match?'){10000000.times{/a/.match?('a'); /b/.match?('a') }} | |
| end |
Author
pocke
commented
Oct 30, 2016
Author
$ ruby -v
ruby 2.4.0preview2 (2016-09-09 trunk 56129) [x86_64-linux]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment