$ bundle exec ruby benchamrk.rb
Warming up --------------------------------------
before 4.274k i/100ms
after 105.215k i/100ms
Calculating -------------------------------------
before 42.894k (± 3.3%) i/s - 217.974k in 5.087531s
after 1.034M (± 2.1%) i/s - 5.261M in 5.090505s
I noticed that calling accept_language is rare case on our usecases, and in most cases, there is no need to parse Accept-Language.
This change is useful when parsing UserAgent of huge access logs with browser gem.
Benchmark result is followings: