Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

WP-r55607: Comments: Use wp_cache_get_multiple in WP_Comment_Query #266

Merged
merged 2 commits into from
Nov 12, 2023

Conversation

mattyrob
Copy link
Collaborator

Description

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.

https://core.trac.wordpress.org/changeset/55607

Motivation and context

Backport of upstream efficiency enhancement

How has this been tested?

This is a backport, local tests have been passing.

Screenshots

N/A

Types of changes

  • Code efficiency enhancement

spacedmonkey and others added 2 commits July 18, 2023 13:02
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.

WP:Props spacedmonkey, tillkruess, mukesh27.
Fixes https://core.trac.wordpress.org/ticket/57803.

Conflicts:
- src/wp-includes/class-wp-comment-query.php

---

Merges https://core.trac.wordpress.org/changeset/55607 / WordPress/wordpress-develop@c46a30eb1f to ClassicPress.
Copy link
Member

@xxsimoxx xxsimoxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Member

@viktorix viktorix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@mattyrob
Copy link
Collaborator Author

Has two approvals, merging in preparation for v2 repository migration.

@mattyrob mattyrob merged commit 0dc40d1 into develop Nov 12, 2023
10 checks passed
@mattyrob mattyrob deleted the merge/wp-r55607 branch November 12, 2023 10:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants