Closed pd closed 8 years ago
This also simplifies the regexp used in parse_uri for stripping the scheme and hostname from a URI.
parse_uri
As before, profiling and/or benchmarking using this script:
https://gist.github.com/pd/df5b38fed1291e82f672
Note the output of "api-auth-1.4.0", which does not exist; I'm just using that as a cheap form of "I built master and wanted to install it separately from the actual gem I use every day."
Benchmark before and after:
$ V=gem M=bench command ruby profile.rb /Users/khargraves/.gem/ruby/2.2.2/gems/api-auth-1.4.0/lib/api_auth/errors.rb Calculating ------------------------------------- authentic? 1.765k i/100ms ------------------------------------------------- authentic? 18.406k (± 3.0%) i/s - 37.065k $ V=local M=bench command ruby profile.rb /Users/khargraves/sauce/rb/api_auth/lib/api_auth/errors.rb Calculating ------------------------------------- authentic? 2.341k i/100ms ------------------------------------------------- authentic? 25.007k (± 2.1%) i/s - 51.502k
This also simplifies the regexp used in
parse_uri
for stripping the scheme and hostname from a URI.As before, profiling and/or benchmarking using this script:
https://gist.github.com/pd/df5b38fed1291e82f672
Note the output of "api-auth-1.4.0", which does not exist; I'm just using that as a cheap form of "I built master and wanted to install it separately from the actual gem I use every day."
Benchmark before and after: