Just wanted to make a quick share on how to solve one weird Drupal 7 performance related problem. Picture this. Yesterday, your Drupal 7 site run pretty ok, but today it as slow as a snail and you don't remember yourself changing anything. I myself encountered this problem today and spend a good hour looking for a problem source. My problem was connected to a so-called "Avoid re-scanning module directory when multiple modules are missing" bug which is still not resolved. This problem happens if you have some missing modules in your Drupal installation. For example, you could delete or rename module while it's enabled (which happens often on a development machine).
Go to your phpmyadmin and run this query:
SELECT name, filename FROM system WHERE type = 'module' AND status = 1 ORDER BY filename;
You will get a list of all enabled modules. Now verify if you don't have any missing modules in this list. If some modules are missing in your file system do either:
for FN in `drush --extra=--skip-column-names sql-query "SELECT filename FROM system WHERE status = 1"`; do [ ! -f $FN ] && echo "Missing $FN"; done
Credits to a reader with a nickname _lyricnz_ for this tip.
NOTE: Always backup your db before doing any moves!. I hope this advice will help someone.