cformsII Support Forum
Current User: Guest *Frequently Asked Questions*
Search 
Search Forums:


 




more memory improvements

Add a New Topic Reply to Post
Post

Josh Bauguss - Guest

4:59 pm - April 12, 2008

I see you made some memory improvements. Very nice.

I've been continuing to look at WP memory usage. I've finally come across something that might be of use.

Apparently the add_option function has 4 arguments. The 4th argument is "autoload".


By default I've been using add_option("var", "val") By default that 4th argument is yes. So in order to keep wordpress from autoloading options plugins add, that 4th argument needs to be "no" . The get_option function will then get it on demand instead of loading the added options on startup of every page.


If you could change just this in your plugin, you will save folks a bunch of memory. That way cform options only load on pages they are needed instead of every page.


here is the wordpress add_option def for your convenience.


Josh Baugu

Oliver - Admin

6:03 pm - April 12, 2008

posts 3549

Thanks for the info, would you know if the 4 arguments are suppported back to WP v2.0.2 - I need to take that into consideration.

Also, if you ever printed out $GLOBALS you're in for a surprise, there is tons of data I have no idea why WP requires that to be in memory. Put into relation the amount of cforms data stored in mem is almost 'neglectable' < 2-3% for a setup with 3 medium to large forms.

PS: of course the above 2-3% is very much dependent on a couple of things, number of plugins used, type of plugins etc. In the above case, I ran 25 plugins - all no-nonsense top 20 plugins (enhanced search, cache, spam blocking etc.)

Josh Bauguss - Guest

6:43 pm - April 18, 2008

Ya I've learned that the globals var is huge. Especially as more plugins get added. This really comes down to the wordpress folks not trying hard enough to guide plugin authors to a best practice. The wordpress site is unclear on how far back that 4th var goes. You could ask the mailing list or look up the function if you have 2.0.2 somewhere.


They need to teach devs to use that 4th option. Its important when devving a plugin to take into consideration of wether you need them loaded on every page or not. If they would just come up with a best practices page. Maybe someday I will try and piece one together. I'm still learning the wp code base myself though so I'm no expert.


What led me down this path of memory investigation was I got a client who gets 50k uniques a day on his blog. I had to rescue his server as it just couldn't keep up.


Btw, keep up the awesome work. This plugin absolutely rocks. I read that you don't take donations. Just encourage ads. Can they be any type of ad or do they need to be food related?


Oliver - Admin

8:31 pm - April 18, 2008

posts 3549

re. donations: generally the ads should be decent ads and preferably food related. with that said, I don't control the ad approval process ;-) and chances are, if they don't fit they'd be declined. My Amazon wish-list is way safer :-)

re. coding: I don't want to get started - and will make sure to keep it really brief - but the whole WP.org way of handling things, e.g. suggestions, bug reports, plugin developers, coding priorities etc. is so, I mean SOO ludicrous that I've been inclined several times to remove my plugin from the WP.org site and stop developing it further.

Unfortunately aforementioned attitude starts to show in the product, the WP2.5 UI is a bad great example among others. As this seems to become a trend, I will certainly keep an eye wide open for alternative platforms.

Slightly of topic, but with the above said, nothing surprises me.

Add a New Topic Reply to Post


Reply to Topic: more memory improvements
PLEASE READ THE FAQs FIRST! THANK YOU.

NOTE: New Posts are subject to administrator approval before being displayed

Guest Name (Required):

Guest EMail (Required):

Guest URL (required)

Math Required!
What is the sum of: 10 + 8        (Required)

Topic Reply:


 
© Simple:Press Forum - Version 3.1.3 (Build 356)