No, performance would be the same at worst and possibly be improved by overloading on const-ness. Const is evaluated solely at compile time -- even const casts are only evaluated at compile time.
Const functions can theoretically be much faster than their non const bretheren as the compiler knows more information at compile time, but either way I'm uncertain of exactly where xerces spends its time during parse, so I'm uncertain of how much improvement you would really see. Brad > -----Original Message----- > From: Tinny Ng [mailto:[EMAIL PROTECTED]] > Sent: Friday, December 13, 2002 10:34 AM > To: [EMAIL PROTECTED] > Subject: Re: FW: Const-correctness in Xerces and TreeWalker > > > I think we need to think again about this, as it's not only > "createTreeWalker", the DOM document has all those createXXXX methods like > "createElement", "createAtttribute" ..., and then all those inherited > DOMNode interface like "removeChild", "replaceChild" ...etc. If > we have to > overload each and every method with const modifier, it's not only > a tedious > work but also PERFORMANCE may impact badly with all these > overloaded virtual > functions. From my point of view, it just doesn't worth at all. > Performance is much more important. I would prefer leave it as is. > > Tinny > > ----- Original Message ----- > From: "Ingolf Steinbach" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, December 13, 2002 10:00 AM > Subject: Re: FW: Const-correctness in Xerces and TreeWalker > > > > * Jennifer Schachter <[EMAIL PROTECTED]> [2002-12-13 15:55]: > > > This wouldn't help our problem: You cannot overload based on return > > > type... > > [...] > > > On Fri, 13 Dec 2002, Erik Rydgren wrote: > > [...] > > > > DOMDocument* DOMNode::getOwnerDocument(); > > > > const DOMDocument* DOMNode::getOwnerDocument() const; > > [...] > > > > DOMTreeWalker* DOMDocument::createTreeWalker(DOMNode* node, and so > on...); > > > > const DOMTreeWalker* DOMDocument::createTreeWalker(const DOMNode* > node, and > > > > so on...) const; > > > > Note the "const" at the end of the lines. That's not overloading > > on return type (additionally, the second createTreeWalker() takes > > a "const DOMNode*"). So definitively the functions have a different > > signature which makes overloading possible. > > > > Regards > > Ingolf > > -- > > > > Ingolf Steinbach Jena-Optronik GmbH > > [EMAIL PROTECTED] ++49 3641 200-147 > > PGP: 0x7B3B5661 213C 828E 0C92 16B5 05D0 4D5B A324 EC04 > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
