Make WordPress Core

Opened 14 months ago

Closed 13 months ago

Last modified 9 months ago

#57803 closed enhancement (fixed)

Use wp_cache_get_multiple in fill_descendants

Reported by: spacedmonkey's profile spacedmonkey Owned by: spacedmonkey's profile spacedmonkey
Milestone: 6.3 Priority: normal
Severity: normal Version: 4.4
Component: Comments Keywords: has-patch commit
Focuses: performance Cc:

Description

In the fill_descendants method in WP_Comment_Query, there is a loop the calls wp_cache_get. Instead of getting one key at a time, use wp_cache_get_multiple and get all keys at once.

Attachments (2)

Screenshot 2023-02-24 at 15.59.13.png (8.7 KB) - added by spacedmonkey 14 months ago.
Before
Screenshot 2023-02-24 at 15.57.28.png (9.3 KB) - added by spacedmonkey 14 months ago.
After

Download all attachments as: .zip

Change History (9)

This ticket was mentioned in PR #4129 on WordPress/wordpress-develop by @spacedmonkey.


14 months ago
#1

  • Keywords has-patch added

#2 @spacedmonkey
13 months ago

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

@tillkruess commented on PR #4129:


13 months ago
#3

LGTM 👍

#4 @spacedmonkey
13 months ago

  • Keywords commit added

Making this as commit, as this PR as been approved by too long term contributors, @tillkruess @mukesh27. Will commit by the end of the week.

#5 @spacedmonkey
13 months ago

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

In 55607:

Comments: Use wp_cache_get_multiple in WP_Comment_Query.

In the fill_descendants method in WP_Comment_Query, there is a loop the calls wp_cache_get to get child comments. Instead of getting one key at a time, use wp_cache_get_multiple` and get all keys at once.

Props spacedmonkey, tillkruess, mukesh27.
Fixes #57803.

@spacedmonkey commented on PR #4129:


13 months ago
#6

Committed.

Note: See TracTickets for help on using tickets.