Re: [xml] Re: embedded libxml

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Tue Feb 08 2000 - 03:54:51 EST


On Mon, Feb 07, 2000 at 11:04:23AM -0800, Gregory Babior wrote:
>
> Glad I could help. By the way - in doing the following you can
> keep a switch available to compile in either direction:
>
> #define COMPILE_FOR_SPEED
>
> #ifdef COMPILE_FOR_SPEED
>
> /* keep the current NEXT macro as is */
>
> #else
>
> void nextFunc(xmlParserCtxtPtr ctxt)
> {
> // blah blah blah
> }
>
> #define NEXT nextFunc(ctxt)
>
> #endif /* COMPILE_FOR_SPEED */
>
> This works because (fortunately) in all instances of NEXT the variable
> holding the xmlParserCtxtPtr has the same name (ctxt).

   Not fortunate, NEXT() was using ctxt ...

> The best of both worlds, no??

   Well not really because I'm adding more stuff to the xmlNextFunc(),
like the UTF-8 checking of input, and I would rather not include that in
a macro. xmlNextFunc() is too central now to be kept as a macro.
  For me the tests indicate that the speed improvement introduced by
keepting it a macro is not worth the hassle.

> As a reminder - I also found significant size gains in turning the macro
> SKIP_BLANKS into a function. You can do the same thing with this
> as done w/ the NEXT macro above - i.e. you can put in a switch so that
> you don't have to sacrifice the speed if you wish to have it.

  Yep I contemplated doing the same tests for SKIP_BLANKS. I will check
again.

Daniel

-- 
Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes  | Today's Bookmarks :
Tel : +33 476 615 257  | 655, avenue de l'Europe | Linux XML libxml WWW
Fax : +33 476 615 207  | 38330 Montbonnot FRANCE | Gnome rpm2html rpmfind
 http://www.w3.org/People/all#veillard%40w3.org  | RPM badminton Kaffe
----
Message from the list xml@xmlsoft.org
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@xmlsoft.org


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:30:01 EDT