[jdom-interest] (no subject)

Elliotte Rusty Harold elharo at metalab.unc.edu
Thu May 29 12:58:04 PDT 2003


At 2:43 PM -0500 5/29/03, Bradley S. Huffman wrote:

>Is one faster than the other? Is it always? Being someone who prefers not
>to try and second guess the compiler, I had to agree he was right and not
>argue to keep getType.

In my experience the int comparison is *much* faster than the 
instanceof test, at least with Sun's latest 1.4.2 VM on Linux. 
However, I'm not convinced that will always be true. I do find the 
instanceof test to be much more natural and descriptive though, so I 
prefer it.
-- 

   Elliotte Rusty Harold
   elharo at metalab.unc.edu
   Processing XML with Java (Addison-Wesley, 2002)
   http://www.cafeconleche.org/books/xmljava
   http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA



More information about the jdom-interest mailing list