Make WordPress Core

Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#57803 closed enhancement (fixed)

Use wp_cache_get_multiple in fill_descendants

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

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 4 years ago.
Before
Screenshot 2023-02-24 at 15.57.28.png (9.3 KB ) - added by spacedmonkey 4 years ago.
After

Download all attachments as: .zip

Change History (9)

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


4 years ago
#1

  • Keywords has-patch added

#2 @spacedmonkey
3 years ago

  • Milestone Future Release6.3
  • Owner set to spacedmonkey
  • Status newassigned

@tillkruess commented on PR #4129:


3 years ago
#3

LGTM 👍

#4 @spacedmonkey
3 years 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
3 years ago

  • Resolutionfixed
  • Status assignedclosed

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:


3 years ago
#6

Committed.

Note: See TracTickets for help on using tickets.