Re: [xml] RAW && NXT with strncmp()

On Wed, 2003-10-01 at 14:54, Daniel Veillard wrote:
On Wed, Oct 01, 2003 at 02:26:30PM -0400, Chris Anderson wrote:

  never tried icc, I believe it would generate faster code but
my target compiler is obviously gcc :-)

Ironically, I started using icc because it works with gdb better than
g++.  icc is one cool cucumber when it comes to optimizing for x86, too
bad it's not free.

  Well I just want the equality. One of the reasons I was using CUR/NXT
is that I used to do some "buffer grows if needed" code handling in it.
Not the case anymore which allows the optimisation.

Ah, that make sense.

Oops, Bjorn said he tried changing the buffer contents, I missed that.

  Yeah it's not in hot spot (element, attributes and character parsing).
Now if you really want to chase the microsecond, if you manage to
optimize xmlParseCharData in parser.c, then it's an immediate gain !
W.r.t. instruction count cachegrind was a bit surprizing initially
finding 2000045214 cycle cost for the original and 400045209 for
the memcmp, independantly of the string being compared. Makes some
sense once the generated code has been looked at :-)

Yeah, I was disappointed that the compilers didn't generate int compares
instead of string compares for memcmp with a small constant size,
especially since the memories were aligned at compile time.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]