phpgroupware-tracker
[Top][All Lists]
Advanced

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

[Phpgroupware-tracker] [patch #3549] Speed up translation


From: Dave Hall
Subject: [Phpgroupware-tracker] [patch #3549] Speed up translation
Date: Thu, 30 Dec 2004 00:17:52 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041128 Firefox/1.0 (Debian package 1.0-4)

This mail is an automated notification from the patch tracker
 of the project: phpGroupWare.

/**************************************************************************/
[patch #3549] Latest Modifications:

Changes by: 
                Dave Hall <address@hidden>
'Date: 
                Thu 12/30/2004 at 05:05 (Australia/Melbourne)

            What     | Removed                   | Added
---------------------------------------------------------------------------
          Resolution | None                      | Applied


------------------ Additional Follow-up Comments ----------------------------
added to proposed-18






/**************************************************************************/
[patch #3549] Full Item Snapshot:

URL: <http://savannah.gnu.org/patch/?func=detailitem&item_id=3549>
Project: phpGroupWare
Submitted by: Sigurd Nes
On: Sun 12/05/2004 at 14:52

Category:  API -  phpGWapi
Priority:  5 - Normal
Resolution:  Applied
Privacy:  Public
Assigned to:  skwashd
Originator Email:  
Status:  Open


Summary:  Speed up translation

Original Submission:  I think this patch should speed up the translation (lang 
function)

Follow-up Comments
------------------


-------------------------------------------------------
Date: Thu 12/30/2004 at 05:05       By: Dave Hall <skwashd>
added to proposed-18

-------------------------------------------------------
Date: Wed 12/15/2004 at 15:43       By: Caeies <Caeies>
I'll post the "new" patch. Please consider reading it and testing before any 
merge :)

Cheers,
Caeies

-------------------------------------------------------
Date: Wed 12/15/2004 at 15:11       By: Caeies <Caeies>
OK,

I made some little stats with xdebug (it's very empirical, so take with care).

I count 119 calls to lang() in the begining of filemanager/index.php (between 
it seems that some strings are translated but never displayed ...)

In the actual code, It took nearly 0.2075 sec to load the translation, then 
each call take ~ 0.00105 sec ...
So doing the arithmetics leed to around 0.3314 sec in total for the lang call 
...
Now in the second case :
If the string is missing it takes ~ 0.0026 sec foreach call, 
so in this condition, the worst case (ie each string is required only one time) 
give 0.3094 sec (so in fact this is less since a call to an already existing 
string take 0.0012 sec, and they are some of them)

So if you have less than ~ 150 calls to lang() the second option is the best 
(still a problem with the load of the sql server ...), with more than 150 calls 
your are in bad mood.

But when I speak about 150 calls that's unique strings, so the case for this to 
happen is not so frequent (I guess ?)

Notice that this depends of the number of translation required !!!! so this is 
the number of call for filemanager only ... bigger application should have 
different limits ...

So to conclude, i'm not sure that this is a real solution (at least not the 
actual patch, mine will be done soon).
I hope that the shm solution will be able to speed up a lot's this ...

regards,

Caeies

-------------------------------------------------------
Date: Wed 12/15/2004 at 13:27       By: Caeies <Caeies>
Sorry but your patch forgot to use db->addslashes or something like that to 
avoid problems ;)

Cheers,

Caeies

(Will submit something if I found how to do it)






File Attachments
-------------------

-------------------------------------------------------
Date: Wed 12/15/2004 at 15:43  Name: patch_speed_translation.diff  Size: 1.9KB  
 By: Caeies
the new patch, with addslashes and a not rebuild $GLOBALS['lang']
http://savannah.gnu.org/patch/download.php?item_id=3549&amp;item_file_id=3952

-------------------------------------------------------
Date: Sun 12/05/2004 at 14:52  Name: patchfile1.diff  Size: 1.1KB   By: sigurdne
Speed up translation
http://savannah.gnu.org/patch/download.php?item_id=3549&amp;item_file_id=3917






For detailed info, follow this link:
<http://savannah.gnu.org/patch/?func=detailitem&item_id=3549>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/







reply via email to

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