First it does a require, then it instantiates a new object on each call. After removing the require and memoizing the object, I’ve upped the performance of our application by 5 req/s.
The reason was to make Rails.env callable from inside the initializer
block (problem cause by the fact that AS is not loaded by railties
but is actually loaded later by AR).
Sounds OK to me, generally we try to avoid requiring from inside
method definitions as they've historically been a cause of performance
issues. a simple memoized method would probably do the job too