Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

qTranslate performance problems


  #1  
Old Mar 22, 2010, 04:48 PM
DSmidgy
 
10 posts · Jan 2010
Hi,

I have some performance problems with qTranslate and Atahualpa. I read one post (of which I can not find the link) that suggested the incompatibility between the two.

I also did some performance testing. I came to the same conclusion that qTranslate or Atahualpa by itself work OK but together it's a performance hog.
Here are the conclusions of the testing I did if it will be of any help.

On my girl's blog I found out that there are two weak points:
- loading posts (i didn't look further into this),
- loading category menus on the top of the page.

Some statistics:

Pageload for Atahualpa + qTranslate = 2s
- of this categories = 0,5s
- posts (6 excerpts) = 0,5s
- qTranslate = 1,2s ; 9300 queries

Pageload for Atahualpa = 1s
- categories = 0,16s
- posts = 0,4s

Pageload for qTranslate = 1s;
- of this for qTranslate = 0,3s ; 3400 queries

To where I digged:
- atahualpa/index.html (post are in while loop, categories in "get_header" function);
- get_header opens atahualpa/header.php, in which the "bfa_header_config" causes most delays;
- bfa_header_config opens atahualpa/functions/bfa_header_config.php and calls "bfa_hor_cats";
- atahualpa/functions/bfa_hor_cats.php calls wp_list_categories.
If I comment this line, page loads significally faster.
I experimented in qtranslate_hooks.php with some success, but in the process the URLs in the categories got corrupted.

Best regards,
Dominik
  #2  
Old Mar 25, 2010, 02:04 PM
DSmidgy
 
10 posts · Jan 2010
If anyone is interested in a partial solution - in qtranslate_core.php disable this line:
#add_filter('option_'.$option, 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLang uage',0);

Options shouldn't need to be translated anyways.
  #3  
Old Mar 29, 2010, 02:54 PM
extremecarver
 
126 posts · Jul 2009
Wow, this really shaves of some time (about 33% faster).
However if I use it, then the widget titles of "Buy me a Beer" plugin is shown in both languages prefaced by the quicktags.

Any idea why this happens? All my other widge titles translate fine.
Using normal language tags it is no better (still both languages shown - only difference is that the tags themselves in this case do not show up).

Edit:
Actually I found out, that also the inserts at the end of a post by the "Buy me a Beer" plugin, are not translated anymore....

Edit: Widgets are not translated at all anymore using this hack, I had forgotten that I'm using a widget cache plugin for most widgets, hence I did not directly see the effect of them not being translated anymore.
__________________
Don't settle for lousy expensive Maps - Get free Maps based on Openstreetmap with great autorouting for cyclists, hikers and Mountainbikers at http://openmtbmap.org

Last edited by extremecarver; Mar 29, 2010 at 03:09 PM.
  #4  
Old Mar 30, 2010, 12:54 PM
DSmidgy
 
10 posts · Jan 2010
As I'm not having any widgets which need to be translated, you can try to change the hook priority (if I correctly remember the function of that integer).

Original:
add_filter('option_'.$option, 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLang uage',0);
Suggested corrections:
add_filter('option_'.$option, 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLang uage',19);
add_filter('option_'.$option, 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLang uage',20);
add_filter('option_'.$option, 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLang uage',21);
The default priority is 20.
  #5  
Old Apr 2, 2010, 02:08 PM
DSmidgy
 
10 posts · Jan 2010
A little update on speeding up qTranslate.

I installed Xdebug (http://xdebug.org/) and WebGrind (http://code.google.com/p/webgrind/) for debugging Atahualpa and qTranslate. Xdebug is probably a package in your Linux distribution (at least it comes with Ubuntu Server as php5-xdebug). Instructions can be found here: http://giorgiosironi.blogspot.com/20...5-minutes.html.

This way it can be seen that some functions are called more then 10.000 times - on a blog with 500 posts and few thousand comments.
I did a little fix:
- in qtranslate_hooks.php, line 233, add "$GLOBALS['qtHOME'] = rtrim(get_option('home'),"/");"
- in qtranslate_core.php, line 532, change "$home = $GLOBALS['qtHOME'];".
It reduced the calls of apply_filters by 10% and sped up the blog by a few percent.

I thing lots of performance improvements could be made by interpreting the debug logs.
  #6  
Old Apr 2, 2010, 02:18 PM
DSmidgy
 
10 posts · Jan 2010
Another optimization (in bfa_get_options.php):
foreach ($options as $value) {

$option_value = get_option( $value['id'] );
if ($option_value === FALSE) {
$$value['id'] = $value['std'];
update_option($value['id'], $value['std']);
}
else
$$value['id'] = $option_value;

$short_func_name = str_replace("bfa_ata_", "", $value['id']);
$bfa_ata[$short_func_name] = $$value['id'];

}
  #7  
Old Apr 2, 2010, 03:18 PM
DSmidgy
 
10 posts · Jan 2010
And "include (TEMPLATEPATH . '/functions/bfa_get_options.php'); " is called twice:
- in atahualpa/index.php;
- in atahualpa/functions.php.
  #8  
Old Apr 5, 2010, 11:21 AM
extremecarver
 
126 posts · Jul 2009
Quote:
Originally Posted by DSmidgy
As I'm not having any widgets which need to be translated, you can try to change the hook priority (if I correctly remember the function of that integer).

Original:
add_filter('option_'.$option, 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLang uage',0);
Suggested corrections:
add_filter('option_'.$option, 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLang uage',21);
The default priority is 20.
Setting it to 21 works great!

19 and 20 were as slow as usual. 21 Seems to run as quick as if I were disabling it by "#". It's now down to around 0.3-0.4 seconds on 404 error page, max around 1.5 seconds on normal pages with content.
__________________
Don't settle for lousy expensive Maps - Get free Maps based on Openstreetmap with great autorouting for cyclists, hikers and Mountainbikers at http://openmtbmap.org
  #9  
Old Apr 5, 2010, 04:33 PM
extremecarver
 
126 posts · Jul 2009
Well, I did not notice everything. Above works well, if it weren't for page navigation being english only now. So currently on http://openmtbmap.org I only have German page navigation menu, it is not translated to english.

I still wonder why this happens. I'll try out tomorrow some comparisons apache vs nginx on my linux machine. I quickly tried a WEMP on Windows, but nginx does not run smooth at all for me here, and my server is currently down so I had to move my website temporarily and can't try to optimise.

edit - German titles do work. However the translations were lost during a database update. So the only problem are that widgets are not translated using the above hack.
__________________
Don't settle for lousy expensive Maps - Get free Maps based on Openstreetmap with great autorouting for cyclists, hikers and Mountainbikers at http://openmtbmap.org

Last edited by extremecarver; Apr 9, 2010 at 11:58 AM.

Bookmarks

Tags
performance, qtranslate, slow

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
xLanguage similar to qTranslate pedro Languages & Translations 4 Dec 14, 2009 12:21 PM
Titles appear in one language only with qTranslate anneks Plugins & Atahualpa 3 Oct 21, 2009 08:25 AM
qtranslate and atahualpa 3.4.2 menubar or header paolo-from-italy Plugins & Atahualpa 2 Aug 13, 2009 03:13 PM
qtranslate incompatibility Kolya Languages & Translations 0 Jul 21, 2009 03:56 PM
Put the qTranslate language selector into the header or page menu DarrenNI Header configuration & styling 1 Jun 19, 2009 04:01 AM


All times are GMT -6. The time now is 07:56 AM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.