harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Varlamov" <alexey.v.varla...@gmail.com>
Subject Re: [classlib]Make harmony's modularity better
Date Thu, 18 Dec 2008 13:30:39 GMT
> > What we need is a performant version of something like ...
> >    boolean instanceOf(Object obj, String typeName)
> No more ideas, seem we have to chose between these,
> 1. try/catch
> 2. reflection
> The former has more overhead whereas the later has less compiler checking.

AFAIU classloading is involved in both cases, moreover VM neccessarily
records resolution results thus this should not be a performance
issue. In general, reflection has not less overhead at least, and if
we take into account that void catch clause is easily optimized by
JIT, 1st solution is absolute winner.

IMO no need to look for better solution here, numerous reflection
calls around beans would absorb that small potential gain anyway. I
bet no benchmark would show any boost even if we'd implement such
instanceOf(Object obj, String typeName) via vmmagics.


View raw message