Splitting this off as a sub-issue of #238950: Meta: update.module RAM consumption so that each self-contained improvement can be in its own issue, patch and status, instead of trying to fold everything into a monster patch...
Inside _update_process_info_list() (called by update_get_projects()) we generate an array of projects on the site with various info about each one that's important for computing the update status. In there, we're currently stashing the entire contents of the .info file, Just In Case(tm). ;) We really only need a handful of the .info attributes. Stay tuned for a patch with some performance numbers...
Comment | File | Size | Author |
---|---|---|---|
#14 | 669554-14.update_filter_project_info_no_hidden.patch | 576 bytes | dww |
#13 | 669554-13.update_filter_project_info.d6.patch | 1.62 KB | dww |
#1 | 669554-1.update_filter_project_info.patch | 1.62 KB | dww |
Comments
Comment #1
dwwOn a simple D7 test site with core and 3 contribs, the size of the serialized array we save in {cache_update} in the 'update_project_projects' cid went from 16782 bytes to 3097 (the biggest win is *not* saving the 'files' array for each .info file). Tests all still pass, running things manually all works, even with cvs_deploy enabled, etc.
Comment #2
Crell CreditAttribution: Crell commentedEeep. There are a few contribs that currently rely on being able to add their own keys to module info files. The features module comes to mind as one. I'm developing another for D7 right now as well. If we start whitelisting keys in there we're going to break a fair bit of existing contrib functionality.
Comment #4
dww@Crell: this is *just* for the *copy* of that data that's cached by update manager to compute update status. Everyone else is free to do whatever they want.
@testbot: WTF? How on Earth did this patch cause DBLogTestCase to fail? :( Requesting retest. Hurray for deterministic tests! :/
Comment #6
ksenzee@Crell: Sure, but update.module doesn't need those keys, right?
And bumping back to needs review in case testbot is on crack.
Comment #7
Crell CreditAttribution: Crell commentedHm, OK, update module I can't see a reason why it needs anything but name and version. But, er, why is it caching it separately anyway when it can request it from the system table? There's even a utility function for it.
Comment #8
dwwCrell: because it needs this data along with a bunch of other stuff about the project that's computed. And it seems better to just stash what we need all in one place than to have to do separate queries to recreate it all the time whenever we're trying to compute the status (which is every page load in /admin/*, for example).
Test bot was indeed on crack. #1 is RTBC by my tastes... Anyone have a reason why not? ;)
Comment #9
Dave ReidNope.
Comment #10
Crell CreditAttribution: Crell commentedOK, I misunderstood what we were doing here. No objection from me. Carry on.
Comment #11
webchickThis seems like a sensible improvement, with nice results (~80% reduction?). Committed to HEAD.
I had asked in IRC whether we needed to care about dependencies[] for sub-themes, and dww pointed out that we use 'base theme' property for that, and that's already cached elsewhere.
I also asked whether we need to backport this to D6, but since the files[] array was the biggest issue, and we don't have that in D6, we're probably okay.
Comment #12
dwwWell, actually, patch #1 applies (with minor fuzz) to DRUPAL-6, and it won't hurt anything. It will allow us to avoid caching stuff like 'description', 'dependencies', and other info that we don't care about, all of which can add up, especially since we carry this data around. Might as well backport to D6...
Comment #13
dwwActually, minor reroll to a) remove fuzz/offsets and b) remove 'hidden', since that's a new concept in D7.
Comment #14
dwwOh, and now that I think about it, we don't need to cache 'hidden' in D7, either, since we already ignored modules that are 'hidden' by the time we get here. So, here's a trivial patch for HEAD to remove that from the whitelist...
Comment #15
dwwwhoops, #14 is for D7 -- changing version for the bot...
Comment #16
moshe weitzman CreditAttribution: moshe weitzman commentedComment #17
webchickCommitted to HEAD. Back to 6.x.
Comment #18
dww#13 is RTBC for D6. It's identical to what's in HEAD now except it applies cleanly to that branch. ;)
Comment #19
mikejonesok CreditAttribution: mikejonesok commentedThanks for the patch. It helps.
Comment #20
Gábor HojtsyThanks, committed to Drupal 6 too.
Comment #21
dwwYay, thanks!
Comment #22
Gábor HojtsyGrm, this made Drupal 6.16 incompatible with PHP 4, see #732096: Fatal error: Call to undefined function: array_intersect_key() in url/modules/update/update.compare.inc on line 695.
Comment #23
webchickComment #24
webchickOops. I see that other patch is RTBC.
Comment #25
Dave Reid? :)
Comment #26
Dave ReidErr...wow. I got lost between the two issues.