Globalized is too slow, need a solution

hello,

I need a help, or maybe advice how to localize my application.

now i used Globalized, it’s works perfectly, BUT

  1. when i tried to localized my admin pages which used activescaffold it
    works very-very SLOW, check a log

Completed in 6.39100 (0 reqs/sec) | Rendering: 0.00000 (0%) | DB:
0.01600 (0%) | 200 OK
[http://localhost/en/kvarturas/new?_method=get&adapter=_list_inline_adapter]

Without globalized this i can get 5-10 request per second!!!

2)please check this pert of log(why i always checking translation in
database for the same labels)

Rendered
…/…/vendor/plugins/active_scaffold/frontends/default/views/_form
(6.26500)

SQL (0.000000) BEGIN

Globalize::ViewTranslation Load (0.000000) SELECT * FROM
globalize_translations WHERE (tr_key = ‘Create’ AND language_id = 1819
AND pluralization_index = 1 AND namespace IS NULL) AND (
(globalize_translations.type = ‘ViewTranslation’ ) ) LIMIT 1

SQL (0.000000) COMMIT

SQL (0.000000) BEGIN

Globalize::ViewTranslation Load (0.016000) SELECT * FROM
globalize_translations WHERE (tr_key = ‘Create’ AND language_id = 1819
AND pluralization_index = 1 AND namespace IS NULL) AND (
(globalize_translations.type = ‘ViewTranslation’ ) ) LIMIT 1

SQL (0.000000) COMMIT

SQL (0.000000) BEGIN

Globalize::ViewTranslation Load (0.000000) SELECT * FROM
globalize_translations WHERE (tr_key = ‘Cancel’ AND language_id = 1819
AND pluralization_index = 1 AND namespace IS NULL) AND (
(globalize_translations.type = ‘ViewTranslation’ ) ) LIMIT 1

SQL (0.000000) COMMIT

SQL (0.000000) BEGIN

Globalize::ViewTranslation Load (0.000000) SELECT * FROM
globalize_translations WHERE (tr_key = ‘Cancel’ AND language_id = 1819
AND pluralization_index = 1 AND namespace IS NULL) AND (
(globalize_translations.type = ‘ViewTranslation’ ) ) LIMIT 1

SQL (0.000000) COMMIT

Rendered
…/…/vendor/plugins/active_scaffold/frontends/default/views/_create_form
(6.31300)

As you can see - label ‘Create’ it always searching in database for
translation, no caching, always used SELECT.

Please recommend me better localization plugin, better with example,
that works very fast and support for DATES,MONTH’S translation!

Thanks

Is this in production mode, or just development mode? From what I
understand, Globalize does cache ViewTranslations in memory. They would
most likely not be cached in development mode.

-sk

Igor K. wrote:

I need a help, or maybe advice how to localize my application.

now i used Globalized, it’s works perfectly, BUT

  1. when i tried to localized my admin pages which used activescaffold it
    works very-very SLOW, check a log

Completed in 6.39100 (0 reqs/sec) | Rendering: 0.00000 (0%) | DB:
0.01600 (0%) | 200 OK
[http://localhost/en/kvarturas/new?_method=get&adapter=_list_inline_adapter]

Without globalized this i can get 5-10 request per second!!!

2)please check this pert of log(why i always checking translation in
database for the same labels)

Rendered
…/…/vendor/plugins/active_scaffold/frontends/default/views/_form
(6.26500)

SQL (0.000000) BEGIN
[ snip ]

SQL (0.000000) COMMIT

Rendered
…/…/vendor/plugins/active_scaffold/frontends/default/views/_create_form
(6.31300)

As you can see - label ‘Create’ it always searching in database for
translation, no caching, always used SELECT.

Please recommend me better localization plugin, better with example,
that works very fast and support for DATES,MONTH’S translation!

Steve K. wrote:

Is this in production mode, or just development mode? From what I
understand, Globalize does cache ViewTranslations in memory. They would
most likely not be cached in development mode.

-sk

I run it on development mode?

How to cache globalized tableViewTranslations in memory?

Thanks for reply

Look at the documentation. I think it happens automatically in
production mode. The whole purpose of development mode is to reflect
code changes immediately, so there is no caching.

Igor K. wrote:

Steve K. wrote:

Is this in production mode, or just development mode? From what I
understand, Globalize does cache ViewTranslations in memory. They would
most likely not be cached in development mode.

-sk

I run it on development mode?

How to cache globalized tableViewTranslations in memory?

Thanks for reply

Steve K. wrote:

Look at the documentation. I think it happens automatically in
production mode. The whole purpose of development mode is to reflect
code changes immediately, so there is no caching.

Ok I will check it
Thanks for answers

I run it on development mode?
How to cache globalized tableViewTranslations in memory?

if we are talking about the same Globalize Extension here (the
“string”.t one, not the one that goes _(“string”) ) - I found that it
doesn’t cache Strings that don’t exist in the database (or have a
‘text’ column that IS NULL). but when it has found them, then it uses
the cache. you could try out some script/console magic to set all the
translations in the default language to the value in the tr_key-column
an see if this speeds up things.

hope this helps,
phil

Igor K. wrote:

Steve K. wrote:

Look at the documentation. I think it happens automatically in
production mode. The whole purpose of development mode is to reflect
code changes immediately, so there is no caching.

The same situation with production mode,
with globalize activescaffold page rendered - 2 or 3 seconds
without globalizer - 0.2-0.3 seconds
wellcome page with globalize - 20-30 reguests/second
wellcome page without globalize - 7-10 reguests/second

What to do? How to localize pages? But with support for translation
dates.

“string”.t one, not the one that goes _(“string”) ) - I found that it
doesn’t cache Strings that don’t exist in the database (or have a
‘text’ column that IS NULL). but when it has found them, then it uses
the cache. you could try out some script/console magic to set all the
translations in the default language to the value in the tr_key-column

I have found a solution - a patch for globalize, now globalize caching
data.

I have found a solution - a patch for globalize, now globalize caching
data.

Hey, could you share the plugin you found

Have you tried activescaffoldlocalize by Edwin Moss

As i know used gettext plugin?
I get some problems with gettext(i don’t know how to use it properly,
how to add new language, and gettext store all translation to files, but
with globalize i can easily translate pages via administration
pages(because translation stored to database) and after opening pages
translation saved in cache-so it works faster), so when i found patch i
still use globalize.

Thanks

Hi Igor

Have you tried activescaffoldlocalize by Edwin Moss

On Sep 13, 4:09 pm, “Igor K.” [email protected]