patchphpGroupWare - Patches: patch #3549, Speed up translation

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #3549: Speed up translation

Submitter:  Sigurd Nes <sigurdne>
Submitted:  Sun 05 Dec 2004 02:52:35 PM UTC
   
 
Category:  API - phpGWapi Priority:  5 - Normal
Item Group:  None Status:  Done
Privacy:  Public Assigned to:  skwashd
Open/Closed:  Closed

Thu 30 Dec 2004 05:05:19 AM UTC, comment #4: 

added to proposed-18

Dave Hall <skwashd>
Group administrator
Wed 15 Dec 2004 03:43:17 PM UTC, comment #3: 

I'll post the "new" patch. Please consider reading it and testing before any merge :)

Cheers,
Caeies

Caeies <Caeies>
Group administrator
Wed 15 Dec 2004 03:11:16 PM UTC, comment #2: 

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

Caeies <Caeies>
Group administrator
Wed 15 Dec 2004 01:27:11 PM UTC, comment #1: 

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)

Caeies <Caeies>
Group administrator
Sun 05 Dec 2004 02:52:35 PM UTC, original submission:  

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

Sigurd Nes <sigurdne>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #8185:  patch_speed_translation.diff added by Caeies (2KiB - text/x-patch - the new patch, with addslashes and a not rebuild $GLOBALS['lang'])
file #8127:  patchfile1.diff added by sigurdne (1KiB - application/octet-stream - Speed up translation)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by sigurdne (Updated the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-01-24 sigurdne Open/ClosedOpen Closed
    2004-12-30 skwashd StatusNone Done
    2004-12-15 Caeies Attached File- Added patch_speed_translation.diff, #3952
    2004-12-05 sigurdne Attached File- Added patchfile1.diff, #3917

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code