Re: XPP3 optimization
Aleksander Slominski <[email protected]> Tue, 20 May 2003 04:52:03 -0500
| Newsgroups | gmane.text.xml.xmlpull.devel |
|---|---|
| Message-ID | <[email protected]> |
Ville Skyttä wrote: >for some time now, I wanted to check if using final local variables in >Java makes a difference performance-wise. XPP3 seemed like a lib of >suitable size, so I went ahead and tried it out. > >The result is that it indeed seems to be a slight performance >improvement, see the attached patch against xpp3-1.1.2a and the saxbench >results, comparing vanilla (marked w/MXP1 beta1) and patched (MXP1-OPT) >1.1.2a measured on my box, a P4 @ 1.95GHz and Sun's J2SE 1.4.1_02. > hi Ville, looking on results i have not seen big performance improvments (+/-1-5% right?) but i have applied some chnages: did you have maybe chance to run pqrser under profiler and identify what are hot spots? >Feel free to apply if you think it's ok. Here's a summary of the patch: >- final'ize local variables. > i think this has noimpact on performance aqs JITs are now smart enough to figure it out. >- Don't instantiate Booleans. > this unfortunately can not be used as MIDP has no state Boolean.TRUE or Boolean.FALSE AFAIK. >- Eliminate one unused variable. > hotspot probalbly could otimize it out during execution. >- Add one initial size to a StringBuffer. > this is the most useful performance-wise optimizaton(!) >Also attached is a similar patch against 1.1.2.1 xmlpull APIs. > i have finalized some of local variables in XmlPullParserFactory - it will make for safer code to maintain :-) thanks, alek -- "Mr. Pauli, we in the back are all agreed that your theory is crazy. What divides us is whether it is crazy enough to be true." Niels H. D. Bohr ------------------------ Yahoo! Groups Sponsor ---------------------~--> Get A Free Psychic Reading! Your Online Answer To Life's Important Questions. http://us.click.yahoo.com/Lj3uPC/Me7FAA/uetFAA/2U_rlB/TM ---------------------------------------------------------------------~-> To unsubscribe from this group, send an email to: [email protected] Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/