Perf optimization for `url_for` called w/ Hash
Perf optimization for `url_for` called w/ Hash

Benchmarking the existing code:

```ruby
{ :only_path => options[:host].nil? }.merge!(options.symbolize_keys)) 
```

Against optimized code, that does not require a new hash or a merge:

```ruby
options = options.symbolize_keys
options[:only_path] = options[:host].nil? unless options.key?(:only_path)
options
```

We see a statistically significant performance gain:

![](https://www.dropbox.com/s/onocpc0zfw4kjxl/Screenshot%202014-08-14%2012.45.30.png?dl=1)

Updated to not mutate incoming parameters
maicher/rails,EmmaB/rails-1,rossta/rails,Vasfed/rails,untidy-hair/rails,illacceptanything/illacceptanything,lucasmazza/rails,utilum/rails,illacceptanything/illacceptanything,prathamesh-sonpatki/rails,aditya-kapoor/rails,yawboakye/rails,palkan/rails,xlymian/rails,gavingmiller/rails,mtsmfm/rails,kaspth/rails,mtsmfm/railstest,mijoharas/rails,utilum/rails,printercu/rails,flanger001/rails,88rabbit/newRails,MSP-Greg/rails,rails/rails,felipecvo/rails,MSP-Greg/rails,Envek/rails,kddeisz/rails,tjschuck/rails,shioyama/rails,prathamesh-sonpatki/rails,sealocal/rails,vipulnsward/rails,joonyou/rails,lcreid/rails,flanger001/rails,utilum/rails,rbhitchcock/rails,prathamesh-sonpatki/rails,illacceptanything/illacceptanything,prathamesh-sonpatki/rails,iainbeeston/rails,palkan/rails,Vasfed/rails,vassilevsky/rails,voray/rails,sergey-alekseev/rails,iainbeeston/rails,aditya-kapoor/rails,palkan/rails,mohitnatoo/rails,gcourtemanche/rails,illacceptanything/illacceptanything,arunagw/rails,yawboakye/rails,pvalena/rails,joonyou/rails,arjes/rails,deraru/rails,assain/rails,EmmaB/rails-1,illacceptanything/illacceptanything,repinel/rails,rails/rails,kirs/rails-1,kmcphillips/rails,illacceptanything/illacceptanything,notapatch/rails,esparta/rails,yawboakye/rails,bolek/rails,yalab/rails,odedniv/rails,marklocklear/rails,betesh/rails,coreyward/rails,starknx/rails,gauravtiwari/rails,tgxworld/rails,MSP-Greg/rails,Stellenticket/rails,betesh/rails,tijwelch/rails,fabianoleittes/rails,xlymian/rails,ledestin/rails,richseviora/rails,kmcphillips/rails,gfvcastro/rails,mechanicles/rails,lcreid/rails,kamipo/rails,koic/rails,repinel/rails,kamipo/rails,rafaelfranca/omg-rails,schuetzm/rails,tjschuck/rails,repinel/rails,hanystudy/rails,illacceptanything/illacceptanything,yhirano55/rails,fabianoleittes/rails,iainbeeston/rails,yahonda/rails,yawboakye/rails,brchristian/rails,stefanmb/rails,riseshia/railsguides.kr,Stellenticket/rails,kddeisz/rails,mathieujobin/reduced-rails-for-travis,gauravtiwari/rails,deraru/rails,illacceptanything/illacceptanything,stefanmb/rails,yahonda/rails,kmayer/rails,bolek/rails,ngpestelos/rails,matrinox/rails,pschambacher/rails,yhirano55/rails,ttanimichi/rails,aditya-kapoor/rails,betesh/rails,baerjam/rails,hanystudy/rails,kenta-s/rails,jeremy/rails,BlakeWilliams/rails,gfvcastro/rails,coreyward/rails,Vasfed/rails,yasslab/railsguides.jp,deraru/rails,maicher/rails,Edouard-chin/rails,marklocklear/rails,rafaelfranca/omg-rails,bogdanvlviv/rails,arunagw/rails,kddeisz/rails,Stellenticket/rails,kmayer/rails,riseshia/railsguides.kr,arunagw/rails,yahonda/rails,bradleypriest/rails,baerjam/rails,mechanicles/rails,palkan/rails,mtsmfm/railstest,Stellenticket/rails,gcourtemanche/rails,illacceptanything/illacceptanything,pvalena/rails,lcreid/rails,mijoharas/rails,Erol/rails,kachick/rails,Spin42/rails,vassilevsky/rails,untidy-hair/rails,schuetzm/rails,bogdanvlviv/rails,mohitnatoo/rails,brchristian/rails,Edouard-chin/rails,yasslab/railsguides.jp,sergey-alekseev/rails,sergey-alekseev/rails,maicher/rails,tgxworld/rails,rails/rails,illacceptanything/illacceptanything,joonyou/rails,tgxworld/rails,yasslab/railsguides.jp,arjes/rails,notapatch/rails,bradleypriest/rails,schuetzm/rails,mohitnatoo/rails,mathieujobin/reduced-rails-for-travis,Envek/rails,assain/rails,mechanicles/rails,yalab/rails,bolek/rails,georgeclaghorn/rails,rafaelfranca/omg-rails,vipulnsward/rails,gavingmiller/rails,mijoharas/rails,yahonda/rails,stefanmb/rails,illacceptanything/illacceptanything,tjschuck/rails,mohitnatoo/rails,alecspopa/rails,pvalena/rails,sealocal/rails,baerjam/rails,starknx/rails,Sen-Zhang/rails,bradleypriest/rails,richseviora/rails,ledestin/rails,arunagw/rails,kddeisz/rails,notapatch/rails,samphilipd/rails,hanystudy/rails,eileencodes/rails,MichaelSp/rails,Vasfed/rails,shioyama/rails,shioyama/rails,mtsmfm/railstest,kmcphillips/rails,BlakeWilliams/rails,kmcphillips/rails,yhirano55/rails,alecspopa/rails,esparta/rails,kirs/rails-1,kachick/rails,felipecvo/rails,shioyama/rails,tijwelch/rails,flanger001/rails,odedniv/rails,Spin42/rails,sealocal/rails,koic/rails,iainbeeston/rails,samphilipd/rails,Erol/rails,assain/rails,rails/rails,vipulnsward/rails,kenta-s/rails,riseshia/railsguides.kr,gfvcastro/rails,MSP-Greg/rails,travisofthenorth/rails,aditya-kapoor/rails,vipulnsward/rails,kmayer/rails,amoody2108/TechForJustice,betesh/rails,felipecvo/rails,amoody2108/TechForJustice,esparta/rails,kamipo/rails,joonyou/rails,lucasmazza/rails,gfvcastro/rails,voray/rails,tgxworld/rails,vassilevsky/rails,illacceptanything/illacceptanything,printercu/rails,georgeclaghorn/rails,pschambacher/rails,arjes/rails,matrinox/rails,gauravtiwari/rails,rbhitchcock/rails,rbhitchcock/rails,starknx/rails,matrinox/rails,kachick/rails,jeremy/rails,coreyward/rails,Edouard-chin/rails,travisofthenorth/rails,esparta/rails,yalab/rails,xlymian/rails,alecspopa/rails,travisofthenorth/rails,printercu/rails,untidy-hair/rails,lucasmazza/rails,flanger001/rails,EmmaB/rails-1,BlakeWilliams/rails,eileencodes/rails,ngpestelos/rails,amoody2108/TechForJustice,Sen-Zhang/rails,Sen-Zhang/rails,fabianoleittes/rails,jeremy/rails,notapatch/rails,mtsmfm/rails,Erol/rails,pvalena/rails,assain/rails,yhirano55/rails,brchristian/rails,odedniv/rails,koic/rails,ngpestelos/rails,elfassy/rails,fabianoleittes/rails,BlakeWilliams/rails,georgeclaghorn/rails,voray/rails,ttanimichi/rails,MichaelSp/rails,schuetzm/rails,kirs/rails-1,Edouard-chin/rails,deraru/rails,samphilipd/rails,utilum/rails,tijwelch/rails,88rabbit/newRails,bogdanvlviv/rails,mathieujobin/reduced-rails-for-travis,Envek/rails,elfassy/rails,printercu/rails,rossta/rails,Envek/rails,repinel/rails,mtsmfm/rails,illacceptanything/illacceptanything,ttanimichi/rails,rossta/rails,Erol/rails,MichaelSp/rails,riseshia/railsguides.kr,untidy-hair/rails,pschambacher/rails,georgeclaghorn/rails,mechanicles/rails,marklocklear/rails,gcourtemanche/rails,travisofthenorth/rails,eileencodes/rails,kaspth/rails,Spin42/rails,lcreid/rails,illacceptanything/illacceptanything,jeremy/rails,ledestin/rails,baerjam/rails,kaspth/rails,bogdanvlviv/rails,gavingmiller/rails,88rabbit/newRails,tjschuck/rails,eileencodes/rails,yasslab/railsguides.jp,illacceptanything/illacceptanything,yalab/rails,kenta-s/rails,richseviora/rails,elfassy/rails