phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [phpGroupWare-developers] Proposal for method of using application-r


From: Dave Hall
Subject: Re: [phpGroupWare-developers] Proposal for method of using application-related translation
Date: Sun, 10 Feb 2008 22:38:02 +1100

On Sat, 2008-02-09 at 17:04 +0100, Sigurd Nes wrote:
> There is a very simple way to avoid the whole problem:
> In front of the menu-translation-block - if needed: set the
> $GLOBALS['phpgw_info']['flags']['currentapp'] to the application in
> question, and put it back to the incoming value after it is finished.

That is uglier than the original proposal.  The currentapp flag
shouldn't be manipulated like that.

I spent some time today benchmarking the 2 versions of code using my
ReSight working copying (which is mostly up to date).

The test involved creating an array of the unique strings to be
translated from property and calendar's menu classes.  This resulted in
87 strings to be translated.  The test was executed 500 times each, with
a 1 second wait between page refreshes.  There was no header or navbar
loaded and only the time spent processing the translations was measured.
It was run with and without shm.  

The figures below are average execution times.

$only_common version of the code
without shm: 0.01280 sec
with shm:    0.01143 sec

$appname version of the code
without shm: 0.01720 sec
with shm:    0.01394 sec

The figures above show that using the only_common check is faster.

Given that the translation code is probably the most used part of the
API in any script execution, it should be highly optimised.  In the
initial menu load, this can easily be called 200 times.  In most pages
it would be called 20 to 50 times - sometimes more.

Cheers


Dave
-- 
Dave Hall (aka skwashd)
API Coordinator
phpGroupWare
e address@hidden
w phpgroupware.org
j address@hidden
sip address@hidden
       _            ____                    __        __             
 _ __ | |__  _ __  / ___|_ __ ___  _   _ _ _\ \      / /_ _ _ __ ___ 
| '_ \| '_ \| '_ \| |  _| '__/ _ \| | | | '_ \ \ /\ / / _` | '__/ _ \
| |_) | | | | |_) | |_| | | | (_) | |_| | |_) \ V  V / (_| | | |  __/
| .__/|_| |_| .__/ \____|_|  \___/ \__,_| .__/ \_/\_/ \__,_|_|  \___|
|_|         |_|                         |_|Web based collaboration platform






reply via email to

[Prev in Thread] Current Thread [Next in Thread]