Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#56639 closed defect (bug) (fixed)

Avoid excessive `notoptions` lookups

Reported by: tillkruess's profile tillkruess Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.1 Priority: normal
Severity: normal Version: 6.1
Component: Cache API Keywords: has-patch add-to-field-guide
Focuses: performance Cc:

Description

When the notoptions key does not exist in a persistent object cache, it's requested hundreds of times until the first not-option is written.

Change History (8)

This ticket was mentioned in PR #3315 on WordPress/wordpress-develop by tillkruss.


2 years ago
#1

  • Keywords has-patch added

When the notoptions key does not exist in a persistent object cache, it's requested hundreds of times until the first not-option is written.

Trac ticket: https://core.trac.wordpress.org/ticket/56639

#2 @tillkruess
2 years ago

  • Focuses performance added
  • Version set to trunk

This could go into 6.0.3 IMO.

#3 @SergeyBiryukov
2 years ago

  • Milestone changed from Awaiting Review to 6.1

#4 @spacedmonkey
2 years ago

This change seems good to me. Would @SergeyBiryukov @dd32 be willing to commit?

#5 @SergeyBiryukov
2 years ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#6 @SergeyBiryukov
2 years ago

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

In 54345:

Options, Meta APIs: Prevent excessive notoptions key lookups.

When the notoptions key does not exist in a persistent object cache, it was requested hundreds of times until the first not-option is written.

This commit improves performance by setting the value to an empty array to prevent non-existent notoptions key from triggering multiple key lookups.

Follow-up to [4855], [14515].

Props tillkruess, dd32, spacedmonkey.
Fixes #56639.

SergeyBiryukov commented on PR #3315:


2 years ago
#7

Thanks for the PR! Merged in r54345.

#8 @milana_cap
2 years ago

  • Keywords add-to-field-guide added
Note: See TracTickets for help on using tickets.