Just wondering, because for every string in every view / controller / everything, it has to do an extra look up to replace the placeholder. Grated, each of these replacements is balls fast… but.. has anyone noticed significant performance issues?
Just wondering, because for every string in every view / controller / everything, it
Share
When rails loads, it will load up your locale file into memory meaning the cost of time is close to the amount of time it takes to do an in memory lookup. From my experiences this hasn’t slowed down an application to a perceivable level. Here is a benchmark or sorts:
Benchmark.realtime { 10000.times { I18n.t(:hello) } } # => 0.834578037261963Benchmark.realtime { 10000.times { String.new("hello") } } # => 0.00372004508972168Granted the second benchmark isn’t doing a lot, 10000 requests to I18n still results in under a second of time.