Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#15812 closed feature request (duplicate)

Introduce wp_suspend_caching

Reported by: duck_ Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Cache API Keywords: has-patch
Focuses: Cc:


There are some occasions when it may be beneficial to temporarily disable object caching (just adding objects to the cache).

I was doing some testing/profiling of large WXR imports and I noticed calls to wp_cache_add for every single post being imported (from wp_import_post -> get_post -> wp_cache_add). However, for the rest of the import these posts are not queried again making their existence in the cache redundant and using up a lot of memory unnecessarily. See this paste for my quick figures (from $wp_object_cache->stats() and memory_get_peak_usage) from local testing... tl;dr is ~199MB -> ~124MB memory usage for no increase in cache misses when importing 10000 posts.

Attachments (1)

15812.suspend-caching.diff (1.8 KB) - added by duck_ 11 years ago.

Download all attachments as: .zip

Change History (3)

#1 @johnbillion
11 years ago

  • Cc johnbillion@… added

#2 @nacin
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #5389, which I've re-opened.

Note: See TracTickets for help on using tickets.