MyBB Community Forums

Full Version: build_forumbits optimizations?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm on a shared host and, unfortunately, exceeding CPU / memory resources.

I checked page generation times, starting off with the index page.
I found it to average at around 0.15 seconds. On a fresh install of MyBB with similar settings, it took around 0.04 seconds.
I found that almost half the time was taken up by the build_forumbits() function, which seems surprising to me as I have less than 40 active forums (including all categories and sub forums).
The problem lies with PHP, not MySQL (processing time for MySQL is about the same in both cases).
I have confirmed that it is the amount of forums making it slow by copying the forums over to the fresh install, and then testing, as well as deleting all forums and retesting.

I've scanned over the build_forumbits() function, but can't quite think of any things which may help speed it up (significantly), but can't quite see why it's so slow. I am aware that I'll probably loose functionality with some tweaks, but are there any suggestions as to why it could be so slow?

Thanks in advance.


Oh, just another question, do you think sending templates directly to output_page() would save some memory, rather than sending a variable to it? EG:
eval("output_page(\"".$templates->get("the template")."\");");

Or maybe even just send the template name directly to output_page() and remove the parse_page() function (using a variables approach instead of sending large templates to str_replace() )?

Thanks a lot.