Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Small performance improvements to packet-http.c

From: Stephen Fisher <stephentfisher@xxxxxxxxx>
Date: Wed, 7 Nov 2007 17:12:05 -0700
On Mon, Nov 05, 2007 at 09:15:45AM +0200, Kaul wrote:

> Somewhat inspired by the performance improvements to tvbuff, I've made
> some small performance improvements to packet-http.c:

> 1. In the most common cases 'GET ', 'POST', 'HTTP' - compare them
> against the 32bit value of those strings, instead of strncmp(). I
> reckon in most cases it'll be used, and there won't be need for longer
> comparison paths.

Is this a significant enough performance improvement to warrant making
the code a bit harder to read, maintain and understand?  The strncmp()
function, at least in a recent FreeBSD libc, looks pretty quick and
simple as it is.  I am just wondering; I do not mean to discourage you
from you from contributing.


Steve