Geoffrey Young wrote:
httpd -DTRANS_REALLY_LAST -DRESPONSE_REALLY_FIRST
[...]
anyway, I'm not entirely convinced that -D switches are the way to go with
this (imagine the jumble trying to shift just a few phases), but it's
something to chew on over the weekend :)

I'd think that the majority of the users won't need that feature. Those few who would use it, could change the source or use defines.


Looks good, Geoff. But even though it's a startup I guess it's incredibly slow as it has to do strcmp about 120 (20*6) times multiplied by the number of actual -D passed. So let's say there are 5 -Ds. It'll be called 600 times. So here is a suggestion:

Provide a new accessor for ap_server_config_defines table, similar to
ap_exists_config_define but which will support -DFOO=BAR. Of course main.c should be able to split on = as well and populate key/val pairs. Changing the defines to be:


>   -DMODPERL_HOOK_ALL=LAST
>
>   -DMODPERL_HOOK_FIXUP=FIRST
>   -DMODPERL_HOOK_FIXUP=REALLY_FIRST
>   -DMODPERL_HOOK_FIXUP=MIDDLE
>   -DMODPERL_HOOK_FIXUP=LAST
>   -DMODPERL_HOOK_FIXUP=REALLY_LAST

which will simplify the logic and make things much faster.

In any case, you need to lookup MODPERL_HOOK_ALL_* only once I think. Why doing this 20 times? (We have 20 hooks at the moment).

Also I'd go further and use the numbers instead of strings. 0 = MIDDLE, -10 FIRST, -20 REALLY_FIRST, -30 REALLY, REALLY FIRST ;) It's both, faster and gives the user a complete control over the hooks, which you have in C, as you can always say -100. Or may be not, just an idea.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to