[drupal-devel] [bug] redundant function call in system_settings_save()

moshe weitzman drupal-devel at drupal.org
Wed Jul 20 15:17:12 UTC 2005


Issue status update for 
http://drupal.org/node/27131
Post a follow up: 
http://drupal.org/project/comments/add/27131

 Project:      Drupal
 Version:      cvs
 Component:    system.module
 Category:     bug reports
 Priority:     minor
 Assigned to:  Anonymous
 Reported by:  DriesK
 Updated by:   moshe weitzman
 Status:       patch

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.




moshe weitzman



Previous comments:
------------------------------------------------------------------------

Wed, 20 Jul 2005 13:26:20 +0000 : DriesK

Attachment: http://drupal.org/files/issues/system_settings_save.patch (226 bytes)

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.




------------------------------------------------------------------------

Wed, 20 Jul 2005 15:10:44 +0000 : Dries

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();






More information about the drupal-devel mailing list