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



On Wed, Oct 01, 2003 at 06:47:31PM +0200, Bjorn Reese wrote:
On Wed, 2003-10-01 at 15:50, Daniel Veillard wrote:

  That I was looking at it this yesterday actually but I don't feel
that confident about such a change, yet ...

The libc string functions tend to be highly optimized.

Time for informal benchmarking...
[...]
I get roughly the same results if I change the content of 'buffer'.

  Well the problem is that informal benchmarking doesn't really reflect
real life behaviour <grin/>

  I did replace all tests for string comparisons using NXT(4)
or more in parser.c, this is the diff between parser.c 1.323 and 1.322
in CVS. The results are on Red Hat Advanced server 2.1 Celeron 700 compiled
with -g -O2:
  - size of parser.o text segment grew up from 78993 bytes to 80132 bytes
  - the command 
    xmllint --noout --stream --timing --repeat test/valid/REC-xml-19980210.xml
    which exercise parsing an heterogenous document with a DTD, 
    ran a tad bit slower, from 7280ms to 7355ms

And making the change more generally for strings smaller than 4 bytes
increased the size far too much.
I also tested with a more recent version gcc version 3.2.2 20030222
on my Red Hat Linux 9 development machine and I see a similar impact.

On Wed, Oct 01, 2003 at 04:44:14PM +0300, Igor Izvarin wrote:
For my opinion this change will improve the code readability and
maintenance, will reduce the source code size and object code size.

  Well I can agree about code lisibility, for maintainance, I'm not
sure as those parts are unlikely to change. And for object code size
and speed this is actually a penalty.

  So I'm not sure I will actually keep that change.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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