A drop-in replacement for the system.module of Drupal 5.7 which makes your Drupal 5 site use less memory and may even make it faster. The one test that I ran suggested that I got:
- 3% faster performance
- 5% less memory
Performance Benchmark (5.2 version)
This version of the module performs around 3% faster than the stock module in my single test:
Benchmark run on stock Fedora 7 with Apache 2.2.4 (httpd-2.2.4-4.1.fc7) and MySQL 5.0.37 (mysql-server-5.0.37-2.fc7), using ab -n 200 http://hostname/user on a development copy of this site.
The stock system.module:
Requests per second: 3.29 [#/sec] (mean)The low memory version:
Time per request: 304.392 [ms] (mean)
Time per request: 304.392 [ms] (mean, across all concurrent requests)
Transfer rate: 23.64 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 294 303 8.8 301 339
Waiting: 294 303 8.8 301 338
Total: 294 303 8.8 301 339
Requests per second: 3.40 [#/sec] (mean)
Time per request: 293.854 [ms] (mean)
Time per request: 293.854 [ms] (mean, across all concurrent requests)
Transfer rate: 24.48 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 282 293 9.8 290 352
Waiting: 282 292 9.7 290 348
Total: 282 293 9.8 290 352
Memory Benchmark
This module saved 538K memory or 5% of overall site memory usage in the only test I ran.
Using the same setup as above, and testing the same page (the user login page), I added an echo memory_get_usage(); to the end of Drupal's index.php. Without the patch, it printed 11129644, or 10.61MB. With the patch, it printed 10578956, or 10.09MB, a savings of 538K or 5%. This savings won't be realized on the administration pages.
Caveat Emptor
- This patch removes several functions from system.module which are technically "public" functions by Drupal's convention, because they don't start with an underscore. If you have code which relied on one of those functions that got removed, and you're interested in using this, please leave a comment below.
- I haven't thoroughly tested all of the administration functions covered by the system module. If you run into a problem which you believe to be caused by this module, please also leave a comment below.
- As this code is based on Drupal, which is licensed under the GPL, this code is also licensed under the GPL, which means (in the word of said license):
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Installation (whole module version)
To install, simply download the archive, unpack it, and put the files in your modules/system directory. The system.module from the archive will replace the stock drupal system.module.
If you're on a command line, you can do so by switching into the drupal installation directory (running ls should show index.php and cron.php), and running:
wget -O - http://wtanaka.com/system/files/system-5.7.tar.bz2 | bzcat | tar xvf -
Installation (patch version)
From the drupal installation directory (runningls should show index.php and cron.php), run:wget -O - http://wtanaka.com/system/files/system-5.7.patch.bz2 | bzcat | patch -p0
Uninstall (patch version)
From the drupal installation directory (runningls should show index.php and cron.php), run:wget -O - http://wtanaka.com/system/files/system-5.7.patch.bz2 | bzcat | patch -p0 -R
rm -f modules/system/*.inc.php
| Attachment | Size |
|---|---|
| system-5.2.patch.bz2 | 24.27 KB |
| system-5.2.tar.bz2 | 20.12 KB |
| system-5.3.patch.bz2 | 24.27 KB |
| system-5.3.tar.bz2 | 20.12 KB |
| system-5.5.patch.bz2 | 24.25 KB |
| system-5.5.tar.bz2 | 20.13 KB |
| system-5.6.patch.bz2 | 24.29 KB |
| system-5.6.tar.bz2 | 20.17 KB |
| system-5.7.patch.bz2 | 24.29 KB |
| system-5.7.tar.bz2 | 20.17 KB |

Had anyone had any
Had anyone had any experience with this? Is this still being used? Cheers.
If memory serves me right,
If memory serves me right, it's running live on this very site
I just installed it on my site ...
and a quick test of all the pages show the site to still work and using the memory module report from the 2bits site shows a reduction in memory.
http://2bits.com/articles/measuring-memory-consumption-by-drupal-bootstrap-and-modules.html
Thanks for the good work.
PS I did notice when I tried to find this article again on your site I was not able to find it and had to refer to my bookmark. It seems like an important contribution and should be displayed more prominently. :) Of course I could have just missed an obvious link.
Thanks for the feedback, and
Thanks for the feedback, and that's a good point. I've created fast, low memory versions of serveral modules, which you can now find linked from my drupal page. I'd love to hear your experience with those as well.
Just a note to anyone who will be using this
If you are doing a fresh install, use the original system.module file first or you will get errors. Also, the Gallery module that integrates G2 with Drupal requires the original system.module file as well. I am unsure which functions are required but I got a blank page for the General Settings page of the module while using the modified system file.
Gallery module
Version 5.6 of this low memory system module should now support the Gallery module which uses the
system_theme_data()function.