Make WordPress Core

Opened 20 months ago

Closed 19 months ago

Last modified 15 months ago

#57802 closed enhancement (fixed)

Prime post cache in WP_Comments_List_Table

Reported by: spacedmonkey's profile spacedmonkey Owned by: spacedmonkey's profile spacedmonkey
Milestone: 6.3 Priority: normal
Severity: normal Version: 3.1
Component: Comments Keywords: good-first-bug has-patch commit add-to-field-guide
Focuses: performance Cc:

Description

In WP_Comments_List_Table class, the post is title is displayed. This results in lots of single lookups to a post. The WP_Comment_Query class ( and get_comments ), has a param called update_comment_post_cache that primes all post caches in a single call. Set this arg to true in the call to get_comments should improve performance.

Change History (5)

This ticket was mentioned in PR #4156 on WordPress/wordpress-develop by adarshakshatPosimyth.


20 months ago
#1

  • Keywords has-patch added

Set "update_comment_post_cache" param to true when calling get_comments in WP_Comments_List_Table https://core.trac.wordpress.org/ticket/57802

Trac ticket:

#2 @spacedmonkey
19 months ago

  • Keywords commit added
  • Milestone changed from Future Release to 6.3
  • Owner set to spacedmonkey
  • Status changed from new to assigned

Assigning to myself, to 6.3 and marking ready to commit. Will merge when trunk opens again for 6.3 release.

#3 @spacedmonkey
19 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 55513:

Comments: Prime post caches in WP_Comments_List_Table.

In the WP_Comments_List_Table class, when the function get_comments is called, pass the parameter update_comment_post_cache set to true. This primes all the related posts for the displayed comments. This improves performance, as all posts are primed at once.

Props spacedmonkey, adarshposimyth.
Fixes #57802.

#5 @milana_cap
15 months ago

  • Keywords add-to-field-guide added
Note: See TracTickets for help on using tickets.