Proof of Concept: code generation module

Events happening in the community are now at Drupal community events on www.drupal.org.
casey's picture

Hi,

I've been testing some code generation techniques for Drupal; I created a module that copies the code of your drupal installation to a temporary directory. First it splits all functions and class into seperate files. Then it modifies the function calls so that functions gets loaded when needed.

It will decrease memory usage a lot! Especially when a great number of modules are installed.

WARNING Please don't try this module on your production website; it'll probably destroy it!

To try the module:

  • Make sure you use Drupal 6
  • download and install dcc.module
  • Move index2.php from dcc directory to your drupal root
  • Goto Admin > Drupal Compiler > Build and run it
  • Call yoursite.com/index.php?q={path}
  • Or rename index.php to something else, and index2.php to index.php

    Note that this module is more of a proof of concept than an actual module! What do you think? Could be an alternative/addition to the registry in D7?

  • Comments

    Split mode!

    boris mann's picture

    chx coded this in 2005 :P http://drupal.org/node/35657

    and stopped...

    greggles's picture

    When he found opcode caching ;)

    These scripts only help if you don't use opcode cache. If you are worried about performance, use an opcode cache.

    --
    Growing Venture Solutions | Drupal Dashboard | Learn more about Drupal - buy a Drupal Book

    Well I don't think so: I

    casey's picture

    Well I don't think so: I always use eaccelerator.

    I tested my module with 20+ modules (views, cck, panels, etc). average memory usage: 12 - 17 MB per request.

    With dcc.module it is somewhere between 5 - 12 MB.

    And secondly, registry in D7 has same purpose: not to load unnecessary code. This module does the same without extra database queries.

    High performance

    Group notifications

    This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: