attached patch cleans up and optimises the registry some more.
1. don't write the registry hook or file caches if nothing has changed - two less db writes for 99% of requests.
2. don't drupal_load
modules in bootstrap_invoke_all
- its now redundant
3. new function registry_load_path_files
--> load the files in the registry cache for earlier (during DRUPAL_BOOTSTRAP_PATH), so we avoid a couple of db lookups in drupal_function_exists calls that happen before the menu system takes over.
4. save a different set of files in registry_cache_path_files
for logged in vs anon users. this makes the cache more effective.
Comment | File | Size | Author |
---|---|---|---|
#7 | more_faster_5.patch | 3.81 KB | Anonymous (not verified) |
#6 | more_faster_4.patch | 3.09 KB | Anonymous (not verified) |
#4 | more_faster_3.patch | 2.99 KB | Anonymous (not verified) |
more_faster_2.patch | 4.14 KB | Anonymous (not verified) | |
Comments
Comment #1
Dries CreditAttribution: Dries commented+ $cache_id = 'registry_' . ($user->uid ? 'logged_in:' : 'anon:') . $_GET['q'];
Can we use 'authenticated' and 'anonymous' for consistency?
Also, the code comments need work.
Comment #2
chx CreditAttribution: chx commentedYou are replacing the router item with the actual path. That makes the caching much less efficient -- tons and tons of duplicates.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedjust a quick note to say that based on discussions with chx, this patch will get stripped back to just the 'don't write to cache if nothing is changed' part, and we'll open separate issues to tackle the 3. and 4. from the issue description.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedand here's the patch for 'don't write to cache if nothing is changed'.
Comment #5
catchwarning: sort() expects parameter 1 to be array, null given in includes/bootstrap.inc on line 1330.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedegg, meet face.
catch, thanks for the fast review. here's a non-FAIL patch.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedmore egg, more face. mmmm, egg.
this time with the call to
registry_load_path_files
.Comment #8
catchpre-patch: 4057 passes, 122 fails and 15 exceptions.
post-patch: 4059 passes, 120 fails and 15 exceptions.
Comment #9
catchcross-posted, #7 gives 4057 passes, 122 fails and 15 exceptions.
I'm wondering why the second eggface patch results in two less simpletest failures...
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commented@catch: do you know if its just two change? is it more than two, with some in both directions?
Comment #11
catchDifferent results again unpatched... I'm starting to think these are edge cases/environmental conditions in the tests that might be occurring anyway. On one run of each, here's the tests which report differently. Don't have time to do any more in depth comparison.
Patched:
Aggregator
6 test cases complete:
149 passes, 3 fails and 0 exceptions.
Taxonomy
3 test cases complete:
53 passes, 9 fails and 0 exceptions.
Unpatched:
Aggregator
6 test cases complete:
150 passes, 2 fails and 0 exceptions.
Taxonomy
3 test cases complete:
51 passes, 11 fails and 0 exceptions.
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commented@catch: thanks for the info.
yeah, i get different pass/fail numbers depending on how many tests are run, both patched and unpatched.
if i just run agregator and taxonomy, its consistently all passes, patched and unpatched, but running all of the tests leads to similar but often not the same numbers of failures. there be dragons in there somewhere...
setting this back to RTBC, because i think what we have is issues with simpletest rather than this patch.
Comment #13
catchI agree with that. SimpleTest failures, though interesting, have nothing to do with this.
Comment #14
Dries CreditAttribution: Dries commentedGreat. I've committed this to CVS HEAD. Thanks.
Comment #15
BioALIEN CreditAttribution: BioALIEN commentedAs this has been committed, I'm setting it to fixed.
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.