Skip to:
Content

bbPress.org

Opened 13 days ago

Closed 13 days ago

Last modified 11 days ago

#3679 closed defect (bug) (fixed)

Avoid redundant forum hierarchy updates during topic creation

Reported by: johnjamesjacoby Owned by: johnjamesjacoby
Priority: normal Milestone: 2.6.16
Component: General - Performance Version: trunk
Severity: normal Keywords: has-unit-tests
Cc:

Description

bbp_update_topic_walker() currently loops through every forum ancestor, while each call to bbp_update_forum() recursively updates its own parents. With nested forums, this repeats the same forum updates and makes topic creation increasingly expensive as the hierarchy grows.

A query profile of the bbp_new_topic lifecycle measured 83, 139, and 235 queries at forum depths 1, 2, and 3. Updating the immediate forum once and letting a dedicated forum walker propagate the known freshness values reduces those measurements to 77, 102, and 136 queries.

The same change can avoid recalculating unrelated subforum counts during topic activity and avoid an early duplicate topic voice-count update. Forum, topic, and reply PHPUnit coverage should establish that every affected object is updated once and that freshness metadata reaches each forum ancestor.

This is suitable for trunk and branches/2.6 for 2.6.16. See #3678 for the separate concurrent count-delta follow-up.

Change History (4)

#1 @johnjamesjacoby
13 days ago

In 7455:

Forums: avoid redundant ancestor updates.

Introduce a forum walker so forum, topic, and reply updates each traverse their hierarchy once. Preserve known freshness values while walking parents, avoid unrelated subforum recounts during topic activity, and update topic voice counts once after engagements.

In trunk, for 2.7.

See #3679.

#2 @johnjamesjacoby
13 days ago

  • Owner set to johnjamesjacoby
  • Resolutionfixed
  • Status newclosed

In 7456:

Forums: avoid redundant ancestor updates.

Introduce a forum walker so forum, topic, and reply updates each traverse their hierarchy once. Preserve known freshness values while walking parents, avoid unrelated subforum recounts during topic activity, and update topic voice counts once after engagements.

In branches/2.6, for 2.6.16.

Fixes #3679.

#3 @johnjamesjacoby
11 days ago

In 7476:

Topics: preserve forum context during walker refreshes.

Retain the resolved forum ID during a full topic walker refresh so forum freshness and last-post metadata continue to update after topic moderation and user spam or ham transitions.

In trunk, for 2.7.

See #3679.

#4 @johnjamesjacoby
11 days ago

In 7479:

Topics: preserve forum context during walker refreshes.

Retain the resolved forum ID during a full topic walker refresh so forum freshness and last-post metadata continue to update after topic moderation and user spam or ham transitions.

Merges [7476] to 2.6.

In 2.6, for 2.6.16.

See #3679.

Note: See TracTickets for help on using tickets.