httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [PATCH modules/generators/mod_status.c] performance
Date Fri, 15 Mar 2002 14:24:24 GMT
Jeff Trawick wrote:
> Stas Bekman <> writes:
>>this patch:
>>- removes if (!short_report) { } condition since the code inside this 
>>  condition is already in the block of the same condition.
> Stas, I didn't see that the short_report condition was redundant.
> Please check.

You are correct Jeff.

But the whole code inside if(ap_extended_status) is irrelevant when 
short_report is true. If I'm not mistaken this if() condition should be 
removed including the similar if (!short_report) before the for loop and 
simply to say:

  if (ap_extended_status && !short_report) {
      if (no_table_report)

      for (i = 0; i < server_limit; ++i) {
         for (j = 0; j < thread_limit; ++j) {

Am I right? This also saves a few hundred if not thousands if() calls on 
servers with many threads.

This code definitely needs some loop unrolling/simplifications, it's 
extremely hard to follow the logic when the bodies of the conditions are 
so big.

> Also, I guess I shouldn't try to simultaneously commit code and try to
> get my daughter to wake up and eat breakfast because I forgot to add a
> "Submitted by:" to the commit.  Sorry!

Nuh, that's OK :)

Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker      mod_perl Guide

View raw message