Jump to content

Invision Community Blog


Managing successful online communities


Resource Improvements for 2.3

One of the driving focuses for IP.Board 2.3 was resource usage. We wanted to spend some time on improving the underlying operation of IP.Board, even if this meant not adding a lot of new features on the surface. As with most applications that develop beyond a few releases, over time so many features have been stacked into IP.Board that, while not necessarily ineffecient, we felt we could revamp some of the underlying code to make IP.Board run even better.

We wanted to highlight a few of these changes for those who are interested.

  • The parse_member method of topics.php has been moved to ipsclass.php to make it more centralized, as it's used by many various classes in IP.Board.
  • Similarly the member_set_information method out of profile.phpand into ipsclass.php as well.
  • We've added a new feature that allows skin template bits to be shared across different skin files. With 2.3 you can now simply edit the some template bits and automatically update all skin files where those bits are used. There are several template bits making use of this functionality to help reduce the number of skin files loaded on any given page view.

    If you would like to make use of this functionality (for example, with a custom modification), you can select to share a template bit to another skin file by going to Look & Feel -> Edit Template HTML for the skin -> (Select a skin group) -> (Select a template bit). Click the drop down button where you would normally edit the template's incoming data variables, and hit "Edit Cache Settings". You can select (or review) secondary skin cache files that will share the template bit you are viewing.
  • We've added a few more database indexes based on our analysis of some common database queries that IP.Board runs.
  • With 2.2, we introduced the new profile portal functionality in IP.Board. This uses an iframe to load center content, which requires a second call back to the server to load the center column content. In 2.3 we've pre-loaded the first tab's content to prevent this second request (on the initial profile page load) from being required.
  • For 2.3 we've added a setting in the Admin CP under CPU Saving and Optimization labeled "Use multi-byte safe wordwrap". International users can continue using the word wrap function more suited to matching 2 and 3 byte character sets, while users with only English text on their forum can use a much more effecient word wrapping function that doesn't need to take multi-byte characters into account.
  • We've also added a setting in the Admin CP under CPU Saving and Optimization labeled "Disable Topic Summary". Setting this to Yes will turn off the topic summary displayed at the bottom of the Add Reply page. This setting is Off by default (the summary will still display unless you turn it off).
  • We've disabled the custom error handler by default in IP.Board 2.3, which prevents our custom error handling function from being called with every PHP Notice (which are not displayed). If you'd like to revert this functionality, just edit init.php and change

    define( 'CUSTOM_ERROR', 0 );


    to

    define( 'CUSTOM_ERROR', 1 );

  • We've optimized our post parsing routine by preventing two expensive usort calls from being required, as they are already run when the associated data is saved in the admin CP.
  • We've enhanced our MySQL database driver when doing field_exists and table_exists method calls by
    • Using a 'SHOW FIELDS' query rather than a 'SELECT COUNT(col)' query to determine if a database field exists
    • We cache the fields in a table, and the tables in a database, the first time a field_exists or table_exists query is run to prevent having to query the database for the same data later during script execution
  • Announcements, Private Messages, Calendar Events, and Topic Posts are now parsed entirely on save, rather than when displaying the data (or in the case of topic posts, half on save and half on display). This prevents the parsing from running on display, and prevents having to load several parsing libraries and associated caches when displaying the data.
We've enhanced the rebuild posts tool to also support private messages, calendar events, and announcements for users who will upgrade and need to rebuild the content (to parse html and custom bbcode appropriately). Rebuilding posts will be necessary after upgrading in order to ensure all custom bbcode is parsed, however upon doing so we will be saving many resources at run time, which is by and far a more important consideration.

I hope this helps detail and clarify some of the resource improvements made for 2.3. The good news is that if you didn't notice any of these things already here on the company forums, then our changes are working exactly as we had hoped - same surface functionality, a much stronger backend to handle it.

Comments

Recommended Comments

I'm a little concerned about the template sharing and possible issues related to it, but I suppose I'll have those concerns answered when the release is available. Everything else looks promising. Can't wait to see the rest of the feature list :D

Link to comment
Share on other sites

We've enhanced the rebuild posts tool to also support private messages, calendar events, and announcements for users who will upgrade and need to rebuild the content (to parse html and custom bbcode appropriately). Rebuilding posts will be necessary after upgrading in order to ensure all custom bbcode is parsed, however upon doing so we will be saving many resources at run time, which is by and far a more important consideration.

Could you explain this a bit more?

* Announcements, Private Messages, Calendar Events, and Topic Posts are now parsed entirely on save, rather than when displaying the data (or in the case of topic posts, half on save and half on display). This prevents the parsing from running on display, and prevents having to load several parsing libraries and associated caches when displaying the data.



Link to comment
Share on other sites



I hope it's on by default (as I understand that's when international users can continue posting freely)



nice!

# For 2.3 we've added a setting in the Admin CP under CPU Saving and Optimization labeled "Use multi-byte safe wordwrap". International users can continue using the word wrap function more suited to matching 2 and 3 byte character sets, while users with only English text on their forum can use a much more effecient word wrapping function that doesn't need to take multi-byte characters into account.

# We've also added a setting in the Admin CP under CPU Saving and Optimization labeled "Disable Topic Summary". Setting this to Yes will turn off the topic summary displayed at the bottom of the Add Reply page. This setting is Off by default (the summary will still display unless you turn it off).

Link to comment
Share on other sites

[quote name='Luke' date='May 10 2007, 03:23 PM']Could you explain this a bit more?

pre_db_parse and pre_display_parse are both run before saving the data to the database.

pre_edit_parse calls a new method to unparse custom bbcode behind the scenes.

Any existing modifications that use our parsing methods don't need to change anything. IP.Board, however, will fully parse data before saving....instead of parsing some (or all) of it when displaying.

[quote name='dlh' date='May 10 2007, 03:54 PM']I hope it's on by default (as I understand that's when international users can continue posting freely)

The word wrap setting is off by default, however it only affects word wrapping, and at that I believe it's only implemented in the profile.php when displaying comments, and other sidebar data presently.

Link to comment
Share on other sites

So when template sharing I hope to see turn out good. So that means I can add my google analytics, and other tracking codes into a cache so it loads in all skins, probably do the same with ads.

Thanks.

Link to comment
Share on other sites

[quote name='StealthAgent87' date='May 10 2007, 05:23 PM']So when template sharing I hope to see turn out good. So that means I can add my google analytics, and other tracking codes into a cache so it loads in all skins, probably do the same with ads.

Thanks.
I don't think that's how it works. :/

The way I read it, you'll be able to take the template Forum Index > render_forum_row and add it to the skin_global.php file, and call it without loading the skin_forums.php along with global. :) Makes it quicker since you won't have to load an entire file just for the one extra template, when it can be included in the other one you're already calling.

If you want to have a template edit cascade just use the parent/child skin feature that's been there forever. B)

Link to comment
Share on other sites

Thanks,

That sound great !
Could you also improve the resource of ipb gallery and ipb blog.
During rush hours, more than 3 500 users are connected simultanously and we have serious database problem.
My community use principaly this two features (70% of this are using the galeries or blogs).

Thanks
Benjamin

Link to comment
Share on other sites

[quote name='benfromaix' date='May 11 2007, 03:58 PM']Thanks,

That sound great !
Could you also improve the resource of ipb gallery and ipb blog.
During rush hours, more than 3 500 users are connected simultanously and we have serious database problem.
My community use principaly this two features (70% of this are using the galeries or blogs).

Thanks
Benjamin

Try submitting a ticket about your issue; :)

Link to comment
Share on other sites

[quote name='Luke' date='May 11 2007, 03:49 PM']With the bbcode parse thingy: Will I have to convert the posts in my database? If so, what if I have like 700 thousand of them?

Yes, you will need to rebuild posts (as well as signatures, announcements, pms, and calendar events).

If you have 700,000 or 700 the process is still the same. As a test run of IPB 2.3, I updated a site with 340,000 posts with few issues using the tool available in the admin cp (once I turned the board offline to block everyone from hitting the posts table).

Link to comment
Share on other sites

[quote name='.Jack' date='Jun 3 2007, 07:51 AM']These are some nice optimizations, but nothing that I can really see improving the overall speed/efficiency of IP.Board that much.

How do you figure? :blink:

Not loading 5 extra files and parsing every post on a topic view provides much greater resource savings than doing so.

Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy

×