evidence on how *slow* and inefficient qTranslate is … please do something
-
I’m not the first one to experience this. I have a normal WP 3.5.1 installation (only a handful of plugins). I have only two languages. This page is also actually very easy on translation without any calls to
__()
,_()
, etc, other than what WP does internally in the loop — actually the page template I have has fixed language titles and meta, and no comments.I profiled this page with qTranslate disabled and with qTranslate enabled. The numbers speak for themselves. Yes, that is 5 (five) times slower when qTranslate is enabled!
qTranslate DISABLED:
https://www.dropbox.com/s/84zfwnuky8qynim/no-qT-Cumul-Time.png
https://www.dropbox.com/s/t900cw3zbj6d5g5/No-qT-Own-Time.png
https://www.dropbox.com/s/uk3miie2tiyfvov/No-qT-Calls.pngqTranslate ENABLED:
https://www.dropbox.com/s/0zoatuyzu5682to/qT-Cumul-Time.png
https://www.dropbox.com/s/q8rwrfs2nsde646/qT-Own-Time.png
https://www.dropbox.com/s/8o871hedu4zcr31/qT-Calls.pngThe time is in milliseconds … 1 second vs 5 seconds page load time.
You can see the ridiculously high number of calls to functions such as
qtrans_isEnabled()
,qtrans_use()
,preg_replace()
,in_array()
, etc. A lot of these are unnecessary, and most are expensive. You don’t need preg_replace() all the time. If you absolutely have to use it and must call it so many thousands of times, using the same regex many times, then make sure you analyze and precompile the regex (use theS
modifier) so that it doesn’t have to to compile it on every call. Don’t usepreg_replace()
when you can usestr_replace()
. Don’t use recursive functions if you can do it in a for/foreach loop. And so on and so forth.There are so many inefficient aspects to the qTranslate code causing it to be so slow that it is becomes a real pain to actually fix … I wanted to but gave up realizing I lack the time. I like qTranslate’s idea of storing all languages in the same post (although it could be improved) but I’m seriously thinking of giving up on it because
– of how slow it is
– the lack of support and replies from the authorIs the author still around? Could he please at least reply to this and maybe state whether he’s going to consider improving the code?
Cheers.
p.s. Did I mention the ghastly function names, e.g.
qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage()
?
- The topic ‘evidence on how *slow* and inefficient qTranslate is … please do something’ is closed to new replies.