Re: [SUBMIT] Some experiment to make reflection faster
"Juozas Baliuka" <[email protected]>
| Newsgroups | gmane.comp.jakarta.bcel.devel |
|---|---|
| Message-ID | <009f01c204c2$9fd33220$0111010a@user> |
sorry, this experiment shows nothing, performance is almost the same on 1.4. ----- Original Message ----- From: "Juozas Baliuka" <[email protected]> To: "BCEL Developers List" <[email protected]> Sent: Sunday, May 26, 2002 4:19 PM Subject: [SUBMIT] Some experiment to make reflection faster > It can be used to implements "fast" reflection, > this class implements only "newInstance" at this time. > Usage : > > > System.out.println( "java version:" + > System.getProperty("java.specification.version")); > > > Reflect reflect = Reflect.getReflect(java.util.Vector.class); > long time = System.currentTimeMillis(); > > for( int i=0; i< 1000000; i++ ){ > Object tmp = (java.util.Vector)reflect.newInstance(); > } > > long br = System.currentTimeMillis() - time; > > System.out.println("BCEL REFLECT : " + br + " ms."); > > > time = System.currentTimeMillis(); > > for( int i=0; i< 1000000; i++ ){ > Object tmp = > (java.util.Vector)java.util.Vector.class.newInstance(); > } > > long jr = System.currentTimeMillis() - time; > > System.out.println("JAVA REFLECT : " + jr + " ms."); > > System.out.println( Math.round(( 1 - br/(double)jr )*100) + " %" ); > > } > > Output ( SUN's JVM 1.4 for windows) : > > java version:1.4 > BCEL REFLECT : 281 ms. > JAVA REFLECT : 406 ms. > 31 % > > Diference is more significant on 1.3 > > > > > ---------------------------------------------------------------------------- ---- > -- > To unsubscribe, e-mail: <mailto:[email protected]> > For additional commands, e-mail: <mailto:[email protected]>