<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
<TT><FONT COLOR="#140d0a">hello, </FONT></TT><BR>
<TT><FONT COLOR="#140d0a">thanks for all replies</FONT></TT><BR>
<BR>
<TT><FONT COLOR="#140d0a">here is what i got so far:</FONT></TT><BR>
<BR>
<TT><FONT COLOR="#737373">> The main problem is that Drupal 5 and earlier by design loaded ALL code on </FONT></TT><BR>
<TT><FONT COLOR="#737373">> every page load. In Drupal 6 we introduced split include files for page </FONT></TT><BR>
<TT><FONT COLOR="#737373">> callbacks, so most of those "foo.admin.inc" and "foo.pages.inc" files are not, </FONT></TT><BR>
<TT><FONT COLOR="#737373">> in fact, loaded on every page request but only when needed. There are similar </FONT></TT><BR>
<TT><FONT COLOR="#737373">> techniques that individual modules can implement if necessary for their own </FONT></TT><BR>
<TT><FONT COLOR="#737373">> code, and some of the larger ones like Views and CCK do, but there's no </FONT></TT><BR>
<TT><FONT COLOR="#737373">> central mechanism for it.</FONT></TT><BR>
<BR>
<TT><FONT COLOR="#140d0a">All my modules are split to many .inc files loaded only when needed. But drupal </FONT></TT><BR>
<TT><FONT COLOR="#140d0a">still includes all 67 .module files.</FONT></TT><BR>
<BR>
<TT><FONT COLOR="#737373">> Hooks aren't the issue per se, although it is true that there's a cost to </FONT></TT><BR>
<TT><FONT COLOR="#737373">> checking 50 modules for a hook.</FONT></TT><BR>
<TT><FONT COLOR="#737373">> </FONT></TT><BR>
<TT><FONT COLOR="#737373">> Both of those are seeing major improvements in D7, but they're not anywhere </FONT></TT><BR>
<TT><FONT COLOR="#737373">> near production ready yet.</FONT></TT><BR>
<BR>
<BR>
<TT><FONT COLOR="#737373">> An opcode cache will help immensely for the first problem, as that's the main </FONT></TT><BR>
<TT><FONT COLOR="#737373">> thing it solves. Proper tuning of the cache (you can set it to not even stat </FONT></TT><BR>
<TT><FONT COLOR="#737373">> the disk) will help, too.</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">I tried APC ... load times are faster but not enough :D</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">(according to APC stat, there is enough cache memory and other settings</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">seem OK too)</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">I tried turn off file modification chceking ... not much improvement</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">and APC include_once hack ... with that option set, drupal refused to</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">start ...</FONT></TT><BR>
<BR>
<TT><FONT COLOR="#737373">> Beyond that, depends on your modules. You may find some you do not, in fact, </FONT></TT><BR>
<TT><FONT COLOR="#737373">> need. </FONT></TT><BR>
<TT><FONT COLOR="#140d0a">Actually, problem is that i need all of them ;). There are few core</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">modules. All other modules are custom and are used daily. (Most of them</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">are just form and "do-something-with-external-system" when submitted.)</FONT></TT><BR>
<BR>
<TT><FONT COLOR="#737373">> Others you could look into improving by implementing some sort of lazy-</FONT></TT><BR>
<TT><FONT COLOR="#737373">> loading mechanism like Views does. (I believe Views' mechanism is being split </FONT></TT><BR>
<TT><FONT COLOR="#737373">> off to the ctools module, now in alpha.) You'd have to work with the </FONT></TT><BR>
<TT><FONT COLOR="#737373">> maintainers for those. Some modules wouldn't really support it, sadly.</FONT></TT><BR>
<TT><FONT COLOR="#737373">> For external systems, definitely look into proper caching, even if you think </FONT></TT><BR>
<TT><FONT COLOR="#737373">> it's fast. You can also look into tuning the block cache, or using memcache </FONT></TT><BR>
<TT><FONT COLOR="#737373">> instead of the default db caching, perhaps, but that's probably overkill if </FONT></TT><BR>
<TT><FONT COLOR="#737373">> you are just running an intranet server.</FONT></TT><BR>
<BR>
<TT><FONT COLOR="#140d0a">Problem with caching is that all modules use "live" data, or are</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">generating unique reports. I can't cache anything.</FONT></TT><BR>
<BR>
<TT><FONT COLOR="#737373">> Anyway, that's just general purpose advise. And, um, no, don't hack core. </FONT></TT><BR>
<TT><FONT COLOR="#737373">> Really. You will regret it. Maybe not today, maybe not tomorrow, but soon, </FONT></TT><BR>
<TT><FONT COLOR="#737373">> and for the rest of your life.</FONT></TT><BR>
<BR>
<TT><FONT COLOR="#140d0a">I know that hacking core is the last resort and is generally bad</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">idea :D.</FONT></TT><BR>
<BR>
<TT><FONT COLOR="#140d0a">-------------------------------------------------------------------------------------------------</FONT></TT><BR>
<BR>
<TT><FONT COLOR="#140d0a">And there is another thing that can help: I need that only one module</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">(used most and in critical process) should be as fast as possible. So i</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">tried little trick:</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">There is function list_modules in core returning list of modules witch</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">are then loaded. As i only need one module to be as fast as possible and</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">i don't really care about others. In the list_modules function i check</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">witch module is being loaded (something like if $q is like /is/*). If</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">it's my module - instead of full module list, I return manually created</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">reduced module list. Result is that only 17 modules out of 67 are</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">loaded ... but the problem is that it didn't helped much :( - maybe the</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">bottleneck is somewhere else and not in drupal module load system.</FONT></TT><BR>
<BR>
<BR>
<TT><FONT COLOR="#140d0a">I'm going to try few more tricks :) and I write back when I find out</FONT></TT><BR>
<TT><FONT COLOR="#140d0a">something interesting.</FONT></TT><BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
</BODY>
</HTML>