Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Feb 2012 09:11:51 +0100
From:      Joerg Sonnenberger <joerg@britannica.bec.de>
To:        freebsd-hackers@freebsd.org, hackers@freebsd.org
Subject:   Re: memmem small optimalisation
Message-ID:  <20120224081150.GB23692@britannica.bec.de>
In-Reply-To: <4F46E90B.2050407@delphij.net>
References:  <1BDAF8C6-66A5-4F4F-A2CD-3928A0B10D48@bitpowder.com> <4F46E90B.2050407@delphij.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Feb 23, 2012 at 05:34:03PM -0800, Xin Li wrote:
> Did you benchmarked the change?  Changes like this has to be done very
> carefully since it's possible that the extra time spent on addition
> and subtractions, when multiple by the length of the "long" string,
> may actually defeat the benefit of one less byte worth memory compare
> because the effect of CPU's data cache.

More importantly, if the input was originally aligned, the additional
byte is ~free.

Joerg



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120224081150.GB23692>