[wp-trac] [WordPress Trac] #55463: Add a limit to _prime_*_cache functions

WordPress Trac noreply at wordpress.org
Thu Apr 14 01:29:50 UTC 2022


#55463: Add a limit to _prime_*_cache functions
--------------------------------------+---------------------------
 Reporter:  spacedmonkey              |       Owner:  spacedmonkey
     Type:  enhancement               |      Status:  assigned
 Priority:  normal                    |   Milestone:  6.0
Component:  Cache API                 |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  good-first-bug has-patch  |     Focuses:  performance
--------------------------------------+---------------------------
Changes (by peterwilsoncc):

 * keywords:  good-first-bug has-patch commit => good-first-bug has-patch


Comment:

 Replying to [comment:6 spacedmonkey]:
 > I saw similar results in multiple test runs. The improve is not as much
 as I hoped but it something.
 >
 > Limits normally do improve the performance a query, as they allow
 queries to stop early. But looking at this
 [https://stackoverflow.com/questions/13846691/adding-limit-clause-to-
 mysql-query-slows-it-down-dramatically thread], it seems that the improve
 only comes when query is against a non indexed field.

 I suspect this is why my tests were sometime showing the patched version
 as faster, sometimes the unpatched version.

 I'm inclined to leave it out until you and I are both sure there is a
 gain. Mainly for the sake of code clarity.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55463#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list