MyBB Community Forums

Full Version: Parsed BBCode (html) in the database...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have recently noticed that we can gain a good amount of performance benefits, if we store the bbcode in the database, in "parsed" format. It's common sense, that there are always more views than postings, and also 1 post versus listing of 15 posts surely offers a great difference.

Currently, as I see, MyBB parses the BBCode on-the-fly, which I find nothing wrong with, however, for the big boards having 100s of posts to be parsed on-the-fly, it surely makes a difference. In today's world of tera-bytes of space, it doesn't really matters if it takes few megabytes of extra space for those hundreds of thousands of posts, but it surely makes a great difference, if so much BBCode -> HTML conversion is neglected.

Foreach topic view (I am not sure, but I think it's 10 posts / page? or 15?), you use so many regexes and string functions to convert the BBCodes to HTML, and you can actually save that processing power.

Plus, the same can be true for signatures! While usually on forums with professionals, BBcode is used less in posts, it still is used in signatures. On the other hand, on forums with lots of teenagers and entertainment forums like mine, you have a lot lot of BBcode used all around in the posts and signatures.

It can offer a great performance benefit. So, please consider it in MyBB 2.0 (or in 1.4 if it's far from being released soon).
Actually pre-parsing can be a pain in the butt because you have to change it back to bbcode when editing. And not only that I just personally don't like it.

Also, you might find that performance really isn't much of a problem after you've hung out the queries that take long amounts of time and left them to rot. For instance, Chris Boulton has just rewritten a large portion of update_forum_posts and update_forum_threads functions which in turn has increased performance on large forums to the extent where we will be able to get http://ncaabbs.com/forums/ncaa/mybb up and running at full capacity soon here.

However, I see where your coming from.

Quid Pro Quo, ehy?
Great posts by both of you. Large forums should really be a big concern for mybb 2.0 and it looks like the team is headed in the right direction.
There's also custom bbcode to consider. What happens if you change the custom bbcode? If it's stored as html in the database, then all of the old posts using the custom bbcode aren't going to be changed.

I much prefer having the unparsed text in the database, the way it is now.
Take a look at my reply here: http://community.mybboard.net/showthread...#pid108375

Essentially the post caching system.
Galen Wrote:There's also custom bbcode to consider. What happens if you change the custom bbcode? If it's stored as html in the database, then all of the old posts using the custom bbcode aren't going to be changed.

I much prefer having the unparsed text in the database, the way it is now.
Custom bbcodes can be left to be parsed on fly, if the above mentioned method was to used.

Well, anyways, I like the idea of post caching system better, as it stores the cache for X number of days and that usually means, most of the time, only those posts will be viewed. Because on a forum, usually the latest posts are viewed more than the others. Good luck with implementing it.
Even the standard bbcodes could change. W3C is notorious for deciding on a whim that something we've all been using for years is now "deprecated" (target="_blank" anyone?). So, it's entirely possible that some of the current html used for bbocdes could change in years to come Smile
I don't believe we will be changing to XHTML 1.1 strict sometime soon anyways.
Actually a lot of it has already changed in MyBB 1.4.