#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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 7455: