Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/30/2016 10:28:36 AM (8 years ago)
Author:
netweb
Message:

General Performance: Introduce increase/decrease helper count functions

Previously when a new topic or reply was created, a bunch of queries to recalculate the topic and reply counts for topics and forums were ran. Now these have been replaced with more efficient increase/decrease helper functions to get the current value and just "bump" the count based on the action (new topic-reply/split-topic/move-topic/spam-trash-topic/etc...)

Props thebrandonallen, tharsheblows, netweb
See #1799

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/topics/functions/topic.php

    r5947 r6036  
    182182        $this->assertSame( $topic_id, bbp_get_reply_topic_id( $reply_id ) );
    183183
     184        // Old Topic/Reply Counts
     185        $this->assertSame( 0, bbp_get_forum_topic_count( $old_forum_id, true, true ) );
     186        $this->assertSame( 0, bbp_get_forum_reply_count( $old_forum_id, true, true ) );
     187
     188
    184189        // Retore the user
    185190        $this->set_current_user( $this->old_current_user );
Note: See TracChangeset for help on using the changeset viewer.