You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Remy Maucherat <re...@apache.org> on 2003/04/12 18:22:15 UTC

[5.0] Xerces 2 impact on startup

Just an observation ...
When I remove Xerces 2.3 and rely on the Crimson parser integrated in my 
new JDK (Sun 1.4.2 beta), startup time goes down 20%. Impressive 
difference (I would have thought the later 2.x releases would improve 
performance :-( ).

Remy


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: [5.0] Xerces 2 impact on startup

Posted by Jean-Francois Arcand <jf...@apache.org>.

Remy Maucherat wrote:

> Just an observation ...
> When I remove Xerces 2.3 and rely on the Crimson parser integrated in 
> my new JDK (Sun 1.4.2 beta), startup time goes down 20%. Impressive 
> difference (I would have thought the later 2.x releases would improve 
> performance :-( ). 

And it is not better with 2.4 :-(. As Costin often recommend, we should 
start thinking having a "deploy tool/validation tool" where Xerces will 
be used only if the web-app uses schema for validation. IMO, we can keep 
the validation part as it is but improve the error message in case 
validation is turned on, schema is used and Crimson throws an exception. 
Redirect people to the "validation tool". Something like:

catalina validate -webapp= .

This script can simply call xerces with validation turned on. And then 
we can start improving the error message (the schema error produced 
currently are ugly) by applying xslt to the output.

And only the deploy tool will be broken when a new Xerces is out (just 
kidding ;-)).....

-- Jeanfrancois


>
>
> Remy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: [5.0] Xerces 2 impact on startup

Posted by Costin Manolache <cm...@yahoo.com>.
Remy Maucherat wrote:

> Costin Manolache wrote:
>> Remy Maucherat wrote:
>> 
>> I agree - the startup time is important. Tomcat itself ( with no app )
>> starts very quickly - and IMO caching the context info ( in a .ser file )
>> would take care of most of it. That's why I started to add "Serialiable"
>> markers and sort out the "transient" fields that shouldn't be saved.
>> 
>> However there are many more important issues - I don't expect this to get
>> into 5.0. Getting the code stable and finishing few remaining open issues
>> should be the biggest priority.
>> 
>> Moving back to crimson - or no parser at all for JDK1.4+ - and having
>> a small bundle with ant+xerces+a script that validates an XML file
>> against DTD and schema would be an improvement for startup time,
>> and reduce the size and complexity.  My +1 if anyone wants to propose it
>> :-)
> 
> Yes, that sounds reasonable.
> We could pitch the main distribution as JDK 1.4+, and provide a package
> of binaries for older VMs, as well as that deployer package ?

I have no problem with having the main distribution targeted to JDK1.4, 
or recommending 1.4. 

This has been discussed many times - what's important is to still be able to
run tomcat with JDK1.3 and GCJ, for people who can't use JDK1.4. 

GCJ is important for other reasons as well.


Costin


> Obviously, this may not happen unless contributors show up (this could
> be a nice small project for new developers, hint, hint) :)




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: [5.0] Xerces 2 impact on startup

Posted by Remy Maucherat <re...@apache.org>.
Costin Manolache wrote:
> Remy Maucherat wrote:
> 
> I agree - the startup time is important. Tomcat itself ( with no app )
> starts very quickly - and IMO caching the context info ( in a .ser file )
> would take care of most of it. That's why I started to add "Serialiable"
> markers and sort out the "transient" fields that shouldn't be saved.
> 
> However there are many more important issues - I don't expect this to get
> into 5.0. Getting the code stable and finishing few remaining open issues
> should be the biggest priority.
> 
> Moving back to crimson - or no parser at all for JDK1.4+ - and having 
> a small bundle with ant+xerces+a script that validates an XML file
> against DTD and schema would be an improvement for startup time, 
> and reduce the size and complexity.  My +1 if anyone wants to propose it :-)

Yes, that sounds reasonable.
We could pitch the main distribution as JDK 1.4+, and provide a package 
of binaries for older VMs, as well as that deployer package ?

Obviously, this may not happen unless contributors show up (this could 
be a nice small project for new developers, hint, hint) :)

Remy


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: [5.0] Xerces 2 impact on startup

Posted by Costin Manolache <cm...@yahoo.com>.
Remy Maucherat wrote:

> Costin Manolache wrote:
>> Remy Maucherat wrote:
>> 
>> 
>>>Just an observation ...
>>>When I remove Xerces 2.3 and rely on the Crimson parser integrated in my
>>>new JDK (Sun 1.4.2 beta), startup time goes down 20%. Impressive
>>>difference (I would have thought the later 2.x releases would improve
>>>performance :-( ).
>> 
>> 
>> Well, you know my position - Xerces is a great parser, but we should
>> distribute crimson ( for JDK1.3 ) and use the parser include in 1.4
>> otherwise.
>> 
>> It's not only speed - size also matters, plus the idea that we only need
>> SAX for tomcat runtime.
> 
> Indeed, it's only 200k.
> 
> <sarcasm>
> Anyone around to point out it can't do schema validation ? (which as we
> all know, is a killer feature; for performance, that is ;-) )
> </sarcasm>
> 
> About the startup time, I didn't try to profile or optimize it. I'll
> continue focusing on other optimizations for now, but have to admit this
> is very important for good user experience (like JSP compilation for
> webapps).

I agree - the startup time is important. Tomcat itself ( with no app )
starts very quickly - and IMO caching the context info ( in a .ser file )
would take care of most of it. That's why I started to add "Serialiable"
markers and sort out the "transient" fields that shouldn't be saved.

However there are many more important issues - I don't expect this to get
into 5.0. Getting the code stable and finishing few remaining open issues
should be the biggest priority.

Moving back to crimson - or no parser at all for JDK1.4+ - and having 
a small bundle with ant+xerces+a script that validates an XML file
against DTD and schema would be an improvement for startup time, 
and reduce the size and complexity.  My +1 if anyone wants to propose it :-)



Costin





---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: [5.0] Xerces 2 impact on startup

Posted by Remy Maucherat <re...@apache.org>.
Costin Manolache wrote:
> Remy Maucherat wrote:
> 
> 
>>Just an observation ...
>>When I remove Xerces 2.3 and rely on the Crimson parser integrated in my
>>new JDK (Sun 1.4.2 beta), startup time goes down 20%. Impressive
>>difference (I would have thought the later 2.x releases would improve
>>performance :-( ).
> 
> 
> Well, you know my position - Xerces is a great parser, but we should 
> distribute crimson ( for JDK1.3 ) and use the parser include in 1.4
> otherwise.
> 
> It's not only speed - size also matters, plus the idea that we only need SAX
> for tomcat runtime.

Indeed, it's only 200k.

<sarcasm>
Anyone around to point out it can't do schema validation ? (which as we 
all know, is a killer feature; for performance, that is ;-) )
</sarcasm>

About the startup time, I didn't try to profile or optimize it. I'll 
continue focusing on other optimizations for now, but have to admit this 
is very important for good user experience (like JSP compilation for 
webapps).

Remy


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: [5.0] Xerces 2 impact on startup

Posted by Costin Manolache <cm...@yahoo.com>.
Remy Maucherat wrote:

> Just an observation ...
> When I remove Xerces 2.3 and rely on the Crimson parser integrated in my
> new JDK (Sun 1.4.2 beta), startup time goes down 20%. Impressive
> difference (I would have thought the later 2.x releases would improve
> performance :-( ).

Well, you know my position - Xerces is a great parser, but we should 
distribute crimson ( for JDK1.3 ) and use the parser include in 1.4
otherwise.

It's not only speed - size also matters, plus the idea that we only need SAX
for tomcat runtime.



Costin


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: [5.0] Xerces 2 impact on startup

Posted by Remy Maucherat <re...@apache.org>.
Jess M. Holle wrote:
> Given that Xerces is a heavier (byte-code-quantity-wise) implementation, 
> I would guess that initial classload of this would take substantially 
> longer than Crimson for starters.
> 
> The more interesting/worrisome bit is if additional operations 
> thereafter are much slower...

Well, TC startup is rather segmented (first, modeler descriptors, then 
server.xml parsing, then everything else). I added numbers for the 3 
operations, and all three are consistently 20% slower. Not that it 
wasn't news for Xerces 2.0.x; I thought it would then improve (like TC 
4.x performance, which improves gradually), silly me :)

Remy


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: [5.0] Xerces 2 impact on startup

Posted by "Jess M. Holle" <je...@ptc.com>.
Given that Xerces is a heavier (byte-code-quantity-wise) implementation, 
I would guess that initial classload of this would take substantially 
longer than Crimson for starters.

The more interesting/worrisome bit is if additional operations 
thereafter are much slower...

Remy Maucherat wrote:

> Just an observation ...
> When I remove Xerces 2.3 and rely on the Crimson parser integrated in 
> my new JDK (Sun 1.4.2 beta), startup time goes down 20%. Impressive 
> difference (I would have thought the later 2.x releases would improve 
> performance :-( ).
>
> Remy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org