Forums / Developer / Slow loading times when translation

Slow loading times when translation

Author Message

Martin Leblanc

Tuesday 09 November 2004 4:07:10 am

I have problems with the ts translator. The website has extremely slow loading time (up to 3 minutes) in the other languages than english. I've think that the .ts-file is loaded too many times and therefore causes the slowdown. I have updated the .ts-files with ezlupdate and there not missing any words and there isn't any obsoleted strings. I don't know how to solve this problem. The debug information is shown below:

 Accumulator	 Elapsed	 Percent	 Count	 Average
ini_load				
Load cache	0.0182 sec	0.0182%	5	0.0036 sec
Mysql Total				
Mysql_queries	0.0386 sec	0.0387%	15	0.0026 sec
Looping result	0.0043 sec	0.0043%	14	0.0003 sec
Template Total	92.8343 sec	93.1%	4	23.2086 sec
Template load	0.3297 sec	0.3306%	4	0.0824 sec
Template parser: create text elements	0.0431 sec	0.0433%	14	0.0031 sec
Template parser: remove whitespace	0.0135 sec	0.0135%	14	0.0010 sec
Template parser: construct tree	0.2228 sec	0.2234%	14	0.0159 sec
Template load and register function	0.0077 sec	0.0077%	7	0.0011 sec
Template processing	92.5033 sec	92.7624%	3	30.8344 sec
override				
Cache load	2.3576 sec	2.3642%	30	0.0786 sec
Matching rules	0.0071 sec	0.0071%	12	0.0006 sec
TS translator				
TS init	96.0561 sec	96.3251%	19	5.0556 sec
TS load	95.7846 sec	96.0529%	38	2.5206 sec
class_abstraction				
Instantiating content class attribute	0.0077 sec	0.0077%	20	0.0004 sec
General				
INI string conversion	0.0062 sec	0.0063%	18	0.0003 sec
String conversion	0.2695 sec	0.2702%	56	0.0048 sec
String conversion w/ mbstring	0.2596 sec	0.2603%	56	0.0046 sec
Total script time:	99.7207 sec	

Martin Leblanc

View this in Firefox: www.biocandy.dk/test.html

http://www.opensystems.dk
http://www.site-camp.net

Ole Morten Halvorsen

Tuesday 09 November 2004 4:48:49 am

Hello,

- Do you have mbstring support in PHP?
- Is the site just as slow on the second reload? The translation stuff will be cached, so you should only notice slowdowns on the first reload after installation or after a complete removal of cache.

In 3.5 however, eZ publish is capable of using PHP's XML parser if available. This makes parsing of .ts files _much_ faster. Have a look here: http://ez.no/community/blog/faster_xml

Ole M.

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

Martin Leblanc

Tuesday 09 November 2004 5:08:33 am

- Do you have mbstring support in PHP?

Yes.

-----------------

- Is the site just as slow on the second reload? The translation stuff will be cached, so you should only notice slowdowns on the first reload after installation or after a complete removal of cache.

Yes, it is just as slow the second time. The whole site is working fine except for an extension which generates some pages used as an installation for some software. It is not possible to use cache in this case because the pages need to be unique everytime.

I'm am aware of the .ts file in the "extension/Myextension/translations/" and it's fully translated and working perfect in Linguist.

-----------------

- In 3.5 however, eZ publish is capable of using PHP's XML parser if available. This makes parsing of .ts files _much_ faster. Have a look here: http://ez.no/community/blog/faster_xml

I can't wait...

Martin Leblanc

View this in Firefox: www.biocandy.dk/test.html

http://www.opensystems.dk
http://www.site-camp.net

Martin Leblanc

Wednesday 10 November 2004 4:41:10 am

I have found a solution for my problem: Simply diable texttranslation in the site.ini. When there no i18n, it's working fine, except the texts isn't translated :-(. Instead of using i18n for text translation I use a "translation object" for the texts and translates that object from the admin interface. Then I fetch the content of translation objects from the templates when needed.

Martin Leblanc

View this in Firefox: www.biocandy.dk/test.html

http://www.opensystems.dk
http://www.site-camp.net