# Gettext speed issues

**URL:** <https://www.ruby-forum.com/t/gettext-speed-issues/67480>\
**Category:** Rails I18n\
**Created:** [September 4, 2006, 2:44pm UTC](https://www.ruby-forum.com/t/gettext-speed-issues/67480 "2006-09-04T14:44:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve\_dp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@steve\_dp](https://www.ruby-forum.com/u/steve_dp)\
**Post date:** [September 4, 2006, 2:44pm UTC](https://www.ruby-forum.com/t/gettext-speed-issues/67480/1 "2006-09-04T14:44:20Z")

</div>

Hi,

I noticed gettext severely impacts rendering time, 3-4x slower than  
without. Is  
there any hope of a faster one in the future maybe written in C?

Or any sort of support for pre-translated templates?

Any help or suggestions would be greatly appreciated,

Thanks!

- steve dp

---

<div class="post-metadata">

**Author:** ![steve\_dp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@steve\_dp](https://www.ruby-forum.com/u/steve_dp)\
**Post date:** [September 4, 2006, 6:31pm UTC](https://www.ruby-forum.com/t/gettext-speed-issues/67480/2 "2006-09-04T18:31:51Z")

</div>

Hi,

On Mon, 4 Sep 2006 10:48:28 +0000 (UTC)  
steve dp [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> I noticed gettext severely impacts rendering time, 3-4x slower than without. Is  
> there any hope of a faster one in the future maybe written in C?

Not planed.

Anyway, 3-4x slower? Hmm. It’s too slow. I think it’s special case.

> Or any sort of support for pre-translated templates?

It may be better to use separate rhtml in each locales.  
See  
[http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html#Localized+templates+for+Views%2FActionMailer](http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html#Localized+templates+for+Views%2FActionMailer).

BTW, the next version of Ruby-GetText is faster than older version.  
The sample blog in Ruby-GetText is 1.96 times faster than 1.7.0 in my  
environment.

---

<div class="post-metadata">

**Author:** ![steve\_dp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@steve\_dp](https://www.ruby-forum.com/u/steve_dp)\
**Post date:** [September 6, 2006, 11:45pm UTC](https://www.ruby-forum.com/t/gettext-speed-issues/67480/3 "2006-09-06T23:45:12Z")

</div>

Masao M. \<mutoh highway.ne.jp\> writes:

> > there any hope of a faster one in the future maybe written in C?
> 
> Not planed.

Sad about this 😕

> BTW, the next version of Ruby-GetText is faster than older version.  
> The sample blog in Ruby-GetText is 1.96 times faster than 1.7.0 in my  
> environment.

That’s GREAT to hear, I’m also going to look into the Rails Template  
Optimizer.  
There might be a way to have it work with gettext so that it only  
actually  
has to run the gettext lookup once per string per template and then  
subsequent  
loads theres no more gettext() calls invovled:

[http://railsexpress.de/blog/articles/2006/08/15/rails-template-optimizer-beta-test](http://railsexpress.de/blog/articles/2006/08/15/rails-template-optimizer-beta-test)  
comments 18 → 21
