Customizing SMF > Forks Discussion

BBCode pre-parsing

(1/5) > >>

AngelinaBelle:
http://forum.miranda.or.at/smf-fork-work-progress/post-cache-performance-feature-2028.0.html

Here's an interesting feature of the Nightwish fork -- parse the BBCode once, and store the parsed output in the database.

Pro: Less CPU intensive.
Cons: More space on the database
         images have to be checked, anyway, so posts with images cannot be pre-parsed
         language-dependant renderings cannot be pre-parsed (like "code" and "quote").

青山 素子:

--- Quote from: AngelinaBelle on August 16, 2011, 06:17:42 PM ---Pro: Less CPU intensive.

--- End quote ---

With proper caching, this isn't a huge issue. When it gets to be an issue, the forum would usually be on a hosting solution that would allow special things like caching.


--- Quote from: AngelinaBelle on August 16, 2011, 06:17:42 PM ---Cons: More space on the database
         images have to be checked, anyway, so posts with images cannot be pre-parsed
         language-dependant renderings cannot be pre-parsed (like "code" and "quote").

--- End quote ---

That's a big downside, certain tags would prevent pre-parsing anyway.

I believe vBulletin goes one step further and replaces the post content with the parsed version and just reverses the work when you edit a post. That cuts down on database growth since it's only storing one copy. However, it becomes a problem if the behavior of tags are altered as older posts are already parsed and won't be automatically changed. You'd have to run a full cycle on each post then.

AngelinaBelle:

--- Quote from: 青山 素子 on August 16, 2011, 06:59:15 PM --- However, it becomes a problem if the behavior of tags are altered as older posts are already parsed and won't be automatically changed. You'd have to run a full cycle on each post then.

--- End quote ---
To counter that, you'd have to have some kind of versioning, and "old tags" storage, or else convert all old posts every time you made changes to the tag set. And/or disallow editing on ancient posts (which would allow you to prune the versioning and "old tags" storage).

Eliana Tamerin:
Many "big" boards disallow editing after a certain time anyways, to save on CPU resources.

AngelinaBelle:
So, in order to store only "preparsed" posts, and always be able to back-convert perfectly, you'd need to
* Create a new "tag set version" every time you changed anything about even one tag (remove, add, or modify definition/execution/parameters/etc)
* Store the current "tag set version" with the preparsed post
* Store the old tag sets, for un-parsing old posts
...
* "Prune" old tag set versions, and not allow un-parsing/editing posts for which you haven't stored the old tag set.
* Make sure not to prune away tag sets that belong to posts that are still within the "allowed to edit" window.

Navigation

[0] Message Index

[#] Next page

Go to full version