system_settings_save() first calls cache_clear_all(), immediately followed by menu_rebuild(). However, the first function which is called by menu_rebuild(), is cache_clear_all(), so removing the first call means less db-queries.
Patch (tiny one) attached.

CommentFileSizeAuthor
system_settings_save.patch226 bytesDriesK
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dries’s picture

Good catch. A quick grep learns that this isn't the only place where this is happening:

For the core repository:

$ grep -a4 -r menu_rebuild * | grep cache_clear | grep -v menu.inc
includes/locale.inc-  cache_clear_all("locale:$lang");
modules/system.module-    cache_clear_all();
modules/system.module-  cache_clear_all();
modules/user.module-    cache_clear_all();

For the contributions repository:

$ grep -a4 -r menu_rebuild * | grep cache_clear
ecommerce/cart/cart.module-  cache_clear_all();
sections/sections.module-      cache_clear_all();
sections/sections.module-      cache_clear_all();
moshe weitzman’s picture

I don't think any of those extra cache_clear_all() happen very often. But if they did, it would cause a high cache miss ratio ... I looked into this recently.

Dries’s picture

Status: Needs review » Active

Removed the redundant cache_clear_all()s in system.module and user.module. Still have to investigate the others. Setting this 'active'.

killes@www.drop.org’s picture

Status: Active » Fixed

the locale.inc cache_clean_all() only clears the locale cache.

Contrib needs to look after itself.

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)