| Welcome to WebmasterWorld Guest from 184.108.40.206 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor 2014|
|Optimize Memory Usage?|
storing data in session vs. running same methods on every page
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?
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.
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.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved