Split up code into separate .inc files

dww - August 15, 2007 - 06:11
Project:Update Status
Version:5.x-2.x-dev
Component:Code
Category:task
Priority:minor
Assigned:Unassigned
Status:postponed
Description

One of the things from http://drupal.org/node/155483#comment-284860 that could potentially be backported from the update.module in D6 core is that it's all nicely split up into .inc files for separate parts of the functionality. D5 core's menu system doesn't natively support this as nicely, but we could still get some useful performance gains by splitting functions up into .inc files just like modules/update in D6 core, and only including them when we need them.

#1

sun - June 8, 2008 - 12:56

+1

I've reduced the code size of upgrade_status.module to 2 KB that way. (28 KB in one .admin.inc file that only ever gets included when needed)
I'd love to create a patch. Do you imagine this 1:1 like it's in D6 core? Because update.module is still 21 KB in D6, I'd like to minimize the file size as much as possible, and I don't want to create a patch you'll be rejecting afterwards... ;)

#2

dww - June 9, 2008 - 03:23
Priority:normal» minor
Status:active» postponed

I'm not convinced it's worth spending time on this in the D5 version (which is why I didn't do it already).

That said, I'm curious what you moved out of the .module that's in update.module itself in D6. I tried to keep that as small as reasonably possible (just core hook implementations and a tiny handful of helper functions for those).

Furthermore, my top priority for all this code these days is the refactoring we're discussing over at #238950: Meta: Reduce RAM resource consumption, which is key to resolving a number of problems. Splitting the code into separate .inc files (especially in D5 where there's no support from the menu system for it) is IMHO much lower on the priority list than #238950.

 
 

Drupal is a registered trademark of Dries Buytaert.