Outline feature in validator (was: profiling the Markup Validator with Devel::NYTProf)

Le vendredi 04 avril 2008 à 16:47 -0400, olivier Thereaux a écrit :
> if ($self->{am_in_heading}==1){
> ... in sub W3C::Validator::SAXHandler::data()
> Of course the line itself is not time-consuming, but its being called  
> 1.2 million times (once per character) is really heavy.

(probably not once per character, except in worse case scenarii; in
general, while there is no guarantee that characters be all stuck
together in the data call in the SAX API, it doesn't imply that each
character generates such a call either)

> I'm wondering if it would be possible to make that one line faster.
> 
> But if not, I think we need to reconsider the benefit of the "show  
> outline" feature. That feature is the only reason why we have sub  
> W3C::Validator::SAXHandler::data() at this point.

Err... Is this API call done even when the show outline option isn't
enabled? If so, the best solution might be to make sure it isn't called
unless it is enabled, no?

Dom

Received on Monday, 7 April 2008 06:58:41 UTC