| Welcome to WebmasterWorld Guest from 220.127.116.11 |
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor|
|Optimize Memory Usage?|
storing data in session vs. running same methods on every page
| 6:23 pm on Jun 27, 2009 (gmt 0)|
So my main question is this.
I want to determine wether I should store information in session or run the method for every page call.
Storing to session costs about .5 MB. How can I determine the use of resources for running the methods that create the data?
I need the data for every page. I figure its less work recalculating the data all the time, but has a memory cost.
The memory cost should be the same when the page is being requested regardless of Session or running the data on the fly, but CPU usage will go up during the calculations.
However, I believe php garbage collection will release the memory usage as soon as page request is complete.
Any ideas on how to optimize this?
| 12:09 pm on Jun 28, 2009 (gmt 0)|
well a useful guideline is to store data that rarely changes as session data (e.g. username, dob).
sorry i cant offer anything more specific.
| 12:38 pm on Jun 29, 2009 (gmt 0)|
Thanks...what Im going to do, is calc the array size, and set some limits and play with that. Ill also set a session on/off global for using session for my arrays.
Play with those limits and try to figure out the best combination.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
© Webmaster World 1996-2013 all rights reserved