Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 PreParser Cache (beta)
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #1
PreParser Cache (beta)
This modification does a number of things:
  • Cache preparsed versions of posts.
  • Cache preparsed versions of signatures.
  • Hard replace topic titles (I personally see little reason why "soft"-copies should be kept...)

For those who may not understand what this does, basically, the parser is what turns MyCode into HTML.  However, if you have a large number of smilies and/or custom MyCodes, the parser obviously has to do more work, replacing stuff in posts.
MyBB's parser is run every time someone views the post.  That means, on a thread with about 10 posts, the parser has to go through 10 posts and parse each one.
This modification aims to lessen the load from the parser, by storing preparsed versions of posts in the DB.
How much this increases the speed of your board (primarily showthread.php) will depend probably on quite a number of factors.
I've tried to make this work as fast as possible though - preparsed messages are fetched via joins, so no extra queries are performed.  Updates are performed via similar techniques as updates are performed in my MyPlaza plugin - all updates are cached, and committed to the DB via a single REPLACE INTO query (for each posts and signatures) at shutdown, to make things as fast as possible (and also won't break if the user cancels loading the page Tongue).

(Just FYI, the preparser cache is installed on these boards)

In this plugin, you can specify how long posts/signatures are kept in the cache.


I haven't had much chance to test this out, but it appears to be working fine here.

Due to the nature of how this works, a large number of code edits is required.  Pre-edited MyBB 1.2.12 files are included for convenience.


Installation isn't too difficult (if you haven't modified any files yet) - just upload the contents of the /inc folder to the inc folder in your forum installation directory.  Next, just upload the contents of the /premodified folder to the root of your forum installation directory.  Finally activate the plugin in the AdminCP.
Please feel free to ask any questions, report any bugs, provide suggestions or give any comments.  Thanks!


Update: 1.0
- Fixed /me glitch
- Fixed glitch involving multiple concurrent updates (ie multiple people posting at the same time)

.zip  preparser10.zip (Size: 91.86 KB / Downloads: 1017)

Older versions
.zip  preparser.zip (Size: 86.68 KB / Downloads: 950)(note, contains premodified 1.2.11 files)

My Blog
(This post was last modified: 03-19-2008 09:27 AM by ZiNgA BuRgA.)
01-19-2008 12:25 AM
Find all posts by this user
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: PreParser Cache (beta)
Having run this on my board for a while, I've only encountered two bugs with this, both of which have been fixed in this 1.0 update.

My Blog
03-14-2008 10:06 PM
Find all posts by this user
AglioEoliO Offline
Junior Member
**
Posts: 39
Joined: Jan 2008
Post: #3
RE: PreParser Cache (beta)
I Will try this soon, Thanks Zinga

I´m using Media Temple and in the CPU Report usage "showthread.php" uses more than 40% of my Resources...
03-16-2008 06:20 AM
Find all posts by this user
dared Offline
Junior Member
**
Posts: 19
Joined: Jan 2008
Post: #4
RE: PreParser Cache (beta)
is it works on 1.2.12 too?
03-19-2008 01:12 AM
Find all posts by this user
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #5
RE: PreParser Cache (beta)
Yeah, the update also has pre-modified 1.2.12 files.

I think I forgot to update the first post with the info though...

My Blog
03-19-2008 09:27 AM
Find all posts by this user
dared Offline
Junior Member
**
Posts: 19
Joined: Jan 2008
Post: #6
RE: PreParser Cache (beta)
thx again zinga... you r realy amazing...
03-27-2008 03:32 AM
Find all posts by this user
AglioEoliO Offline
Junior Member
**
Posts: 39
Joined: Jan 2008
Post: #7
RE: PreParser Cache (beta)
could you please update this to mybb 1.213 Zinga..

Thanks
06-04-2008 10:21 PM
Find all posts by this user
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #8
RE: PreParser Cache (beta)
(06-04-2008 10:21 PM)AglioEoliO Wrote:  could you please update this to mybb 1.213 Zinga..

Thanks
Just apply the 1.2.13 patch to the existing pre-modified files - it shouldn't take long...

My Blog
06-05-2008 07:34 PM
Find all posts by this user
dared Offline
Junior Member
**
Posts: 19
Joined: Jan 2008
Post: #9
RE: PreParser Cache (beta)
whats are modifies? or is pre-modified file will work on 1.2.14 ?
08-15-2008 05:00 PM
Find all posts by this user
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #10
RE: PreParser Cache (beta)
Work?  Probably, but I wouldn't recommend it because you'll probably lose the modifications made in 1.2.14...

My Blog
08-15-2008 06:38 PM
Find all posts by this user

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: