Move object allocation out of loop
Move object allocation out of loop

Right now BenchmarkCleaner allocates hundreds of strings on every request with an exception. This patch moves those strings to be generated at boot once and re-used.

## Bench Methods

I took a modified form of CodeTriage https://github.com/schneems/codetriage-ko1-test-app/blob/master/perf.rake and ran given rake tasks with and without the patch to BacktraceCleaner.

I made an endpoint results in exception

```
  def index
    raise “foo"
  end
```

The gem `memory_profiler` was used to capture objects allocated for a single request. Then `benchmark/ips` was used to test the speed of the patch.

You will see that we use less objects and the code becomes measurably faster with this patch.

## With patch:

Memory for one request:

```
Total allocated 7441
Total retained 37
```

Requests per second:


```
Calculating -------------------------------------
                 ips         4 i/100ms
-------------------------------------------------
                 ips       43.0 (±4.7%) i/s -        216 in   5.037733s
```


## Without patch:

Memory used for one request:


```
Total allocated 11599
Total retained 35 
```

Requests per second:

```
Calculating -------------------------------------
                 ips         3 i/100ms
-------------------------------------------------
                 ips       39.4 (±7.6%) i/s -        198 in   5.052783s
```

## Analysis

The patch is faster:

```
(43.0 - 39.4 ) / 39.4 * 100
# => 9 # % ~ speed bump
```

It also allocates less objects:

```
11599 - 7441
# => 4158
```

These strings are allocated on __EVERY SINGLE REQUEST__. This patch saves us 4158 objects __PER REQUEST__ with exception.

Faster errors == Faster applications

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