Make WordPress Core


Ignore:
Timestamp:
02/07/2023 12:07:46 PM (21 months ago)
Author:
spacedmonkey
Message:

Taxonomy: Implement wp_cache_get_multiple in wp_queue_posts_for_term_meta_lazyload.

In [47938] the wp_cache_get_multiple function was added to core. This function allows for multiple cache keys to be received from cache in a single function call. wp_queue_posts_for_term_meta_lazyload function does many calls to cache. To get taxonomy relationship for multiple posts and get all terms. Replace calls to get_object_term_cache with calls to wp_cache_get_multiple and _prime_term_caches. This improves performance on sites that implement the wp_cache_get_multiple in their object caching drop-in.

Props spacedmonkey, ocean90, SergeyBiryukov, costdev, flixos90, joemcgill, 10upsimon.
Fixes #57150.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/abstract-testcase.php

    r55160 r55252  
    195195        $this->_restore_hooks();
    196196        wp_set_current_user( 0 );
     197
     198        $lazyloader = wp_metadata_lazyloader();
     199        $lazyloader->reset_queue( 'term' );
     200        $lazyloader->reset_queue( 'comment' );
    197201    }
    198202
Note: See TracChangeset for help on using the changeset viewer.