|
Posted by howa on June 4, 2008, 11:16 am
Please log in for more thread options
On 6$B7n(B4$BF|(B, $B2<8a(B10$B;~(B09$BJ,(B, Joe Scylla
show/hide quoted text
> Well at least in my benchmarking it is (on Suse and Debian). Remember
> that gettext caches loaded translation file in memory.
> http://mel.melaxis.com/devblog/2006/04/10/benchmarking-php-localizati...
Look interesting.
But...
1. Do you use any kind of op-cache? E.g. eA or XCache (it might make a
differences of 50-100% for your array / pure php implementation)
2. If using APC, take care of codes such as the following, e.g.
require_once("languages/$lang.php");
it might not be cached.
3. require_once() is slow and might be the bottomneck, try require();
Howard.
|
|
Posted by Joe Scylla on June 4, 2008, 12:06 pm
Please log in for more thread options
howa wrote:
show/hide quoted text
> On 6$B7n(B4$BF|(B, $B2<8a(B10$B;~(B09$BJ,(B, Joe Scylla
>
>> Well at least in my benchmarking it is (on Suse and Debian). Remember
>> that gettext caches loaded translation file in memory.
>> http://mel.melaxis.com/devblog/2006/04/10/benchmarking-php-localizati...
>
> Look interesting.
>
> But...
>
>
> 1. Do you use any kind of op-cache? E.g. eA or XCache (it might make a
> differences of 50-100% for your array / pure php implementation)
>
> 2. If using APC, take care of codes such as the following, e.g.
>
> require_once("languages/$lang.php");
>
> it might not be cached.
>
> 3. require_once() is slow and might be the bottomneck, try require();
>
>
> Howard.
I have tested gettext against php array implementation with Zend
Optimizer and eAccelerator installed and used object caches with
different storage engines (eAccelerator shared memory api, MySQL, MySQL
memory tables and tmpfs).
Pure gettext was always faster in my benchmarks (Suse 10.x/Debian
3.1/4.0), but is was *more important* for me that gettext is not
remarkable slower.
Pure php may be faster on some systems (Windows, different Apache, other
version of gettext) but in the major cases it won't be much slower. And
gettext
Joe
|
|
Posted by howa on June 4, 2008, 1:26 pm
Please log in for more thread options show/hide quoted text
> Pure php may be faster on some systems (Windows, different Apache, other
> version of gettext) but in the major cases it won't be much slower. And
> gettext
> Joe
I might suspect the bottomneck is due to the require_once (5000
require_once in a test), you might use xdebug to profile it if you
like.
Personally, I don't think method call is faster then array hashing.
Anyway, just my $0.05 (due to inflation)
Howard
|
| Similar Threads | Posted | | Assertions in real life | November 18, 2008, 5:51 pm |
| gettext.so | April 15, 2008, 6:55 pm |
| Gettext doesn't worh, help! | July 17, 2004, 8:39 pm |
| loading gettext | January 10, 2005, 12:42 pm |
| GETTEXT (not really a question) | July 13, 2005, 6:01 pm |
| Gettext fails me | November 9, 2006, 8:32 am |
| gettext() function | May 29, 2008, 3:46 am |
| Gettext problem | December 18, 2009, 8:06 am |
| gettext vs custom ways | May 10, 2007, 8:02 pm |
| Freebsd locales (gettext) | October 26, 2007, 10:54 am |
|
> that gettext caches loaded translation file in memory.
> http://mel.melaxis.com/devblog/2006/04/10/benchmarking-php-localizati...