You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2012/02/13 17:25:15 UTC

DO NOT REPLY [Bug 52656] New: Code clean up (remove useless tests)

https://issues.apache.org/bugzilla/show_bug.cgi?id=52656

             Bug #: 52656
           Summary: Code clean up (remove useless tests)
           Product: Apache httpd-2
           Version: 2.5-HEAD
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: minor
          Priority: P2
         Component: All
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: christophe.jaillet@wanadoo.fr
    Classification: Unclassified


Created attachment 28320
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28320
Proposed patch

Hi,

In many places of httpd, we are skipping white spaces with code that looks like
:
   while (*l && apr_isspace(*l)) {
       ++l;
   }

The first test against *l is IMO useless and could be removed in order to
improve the generated code.
I.e. :
   while (apr_isspace(*l)) {
       ++l;
   }

apr_isspace is in fact turned to a call to isspace by the apr library and
isspace(0) returns 0.


I also made some measurement.
The version with the test against *l is faster ONLY when the string to scan is
EMPTY. In this case it is more or less 50% faster to completely avoid the call
to isspace.
In ALL other cases, removing the first test is about 15% faster.


The proposed patch removes these, IMO, useless tests.
The modified files are :

 modules/cache/cache_storage.c     |    2 +-
 modules/cache/mod_cache_disk.c    |    2 +-
 modules/cache/mod_disk_cache.c    |    2 +-
 modules/filters/mod_proxy_html.c  |    2 +-
 modules/mappers/mod_imagemap.c    |    2 +-
 modules/mappers/mod_negotiation.c |    8 ++++----
 modules/mappers/mod_rewrite.c     |    2 +-
 modules/metadata/mod_cern_meta.c  |    2 +-
 modules/metadata/mod_headers.c    |    2 +-
 modules/metadata/mod_mime_magic.c |    2 +-
 modules/proxy/mod_proxy_http.c    |    2 +-
 server/util.c                     |    8 ++++----
 server/util_script.c              |    2 +-
 support/httxt2dbm.c               |    2 +-
 14 files changed, 20 insertions(+), 20 deletions(-)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 52656] Code clean up (remove useless tests)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52656

--- Comment #1 from Christophe JAILLET <ch...@wanadoo.fr> ---
Patch must be revised.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52656] Code clean up (remove useless tests)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52656

Christophe JAILLET <ch...@wanadoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 52656] Code clean up (remove useless tests)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52656

Christophe JAILLET <ch...@wanadoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 52656] Code clean up (remove useless tests)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52656

Christophe JAILLET <ch...@wanadoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #28320|0                           |1
           is patch|                            |
  Attachment #28320|application/octet-stream    |text/plain
          mime type|                            |

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 52656] Code clean up (remove useless tests)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52656

Jeff Trawick <tr...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|PC                          |All
                 OS|Windows 2000                |All

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org