Shopify/wolverine — pull request #2 by boourns (2012-10-22 21:15:01+00:00)
Title: Cache script relative path to avoid constant lookups

@burke @hornairs @ssoroka Please review

Profiling object creation with this dtrace probe:

```
sudo dtrace -n 'ruby*:::object-create{@[copyinstr(arg0),copyinstr(arg1),arg2]=count();}' -p 66284
```

Found that in a single request to my local shop's frontpage:

/Users/tom/.rbenv/versions/1.9.3-p194-dtrace/lib/ruby/1.9.1/pathname.rb creates 436 Strings and 436 Pathname objects.

I traced it back to the change in this commit.

After this commit those ~1000 objects do not get instantiated per request. This was #8 and #9 most allocating lines of code in that request.