phpgroupware-developers
[Top][All Lists]
Advanced

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

Re: [Phpgroupware-developers] speed up the translation


From: Chris Weiss
Subject: Re: [Phpgroupware-developers] speed up the translation
Date: Wed, 15 Dec 2004 11:51:08 -0600

The work i planned to do with shm last week got "re-prioritised", I
don't know when I'll be able to get back to it.

I did make a test cli script and some generic functions to kind of see
how shm works, and that is gzippped and attached.  Should be pretty
easy to toss it into a class, transferring current data to it will be
the tricky part, but the test script has a basic example of how to
work that in too.

tricks of shm:
- you have to tell it the max size of the data you will be storing
upfront, and use that same size every time you ask for data from it. 
This will be difficult.
- you want to use as few shm variables as you can get away with, but
arrays are handled easily.  Storing several things into one array and
putting that in shm is the ideal way.
- shm is handled in a similar way as a file, you have to read it into
php then use the vars, you can't directly access the shm.  This means
it won't reduce our memory footprint, but could speed things up
because shm is faster than a database or a file for a static
structure.

The useful application of shm for us is to put data in it that is not
going to change very often, such as translations and global values
that are kept in the phpgwinfo array.  I didn't get a chance to
benchmark things like "is it faster to load all possible lang in shm
and call it out for every user or is it faster to load only the langs
that each user wants from the database seperatly for every user?" 
Obviously, the shm method will use a lot more memory, but most
installs have only a couple langs installed anyway.

Attachment: shmtest.php.gz
Description: GNU Zip compressed data


reply via email to

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