James Watson
Posts: 2024
Nickname: watson
Registered: Sep, 2005
|
|
Re: Lorenzo Puccetti on Event-Driven Architecture
|
Posted: Sep 17, 2007 6:27 AM
|
|
> Just I said I see no points on starting yet another flawed > micro benchmark flame.
You are suggesting a micro-optimization. What other kind of benchmark would be applicable. Actually, to be correct, you are suggesting a nano-optimization.
> And your benchmark code is flawed > in many ways, it's even hard to say what it actually > measures :).
I think you don't understand it.
> I suggest you to take a look at the following article of, > well, much more respected author than me ;) > > http://www.ibm.com/developerworks/library/j-jtp12214/
I've read it before.
> And I still insist that interface calls are slower to > dispatch. Just think this (much simplified) way -- to > lookup method of the concrete class you have to perform > one VMT lookup as methods of the concrete class are > ordered in a single table, to lookup interface method you > have to perform *several* lookups at least in interface > method table and class method table. There are a lot > efforts were put to optimize interface method lookups but > all what can be done is corner cases optimizations and > various tricks in building interface method tables. so > strictly speaking lookup time can be ordered that way: > interface >= class >= class + final/private method > modifier
I didn't say it doesn't take longer. I said it's not significant. My test shows that the interface does take longer and consistently so. It's just that the difference is measured in nanoseconds.
> well to sum up -- in real project targeting high volume > realtime data you might want to keep interface calls > constant over execution path (independent of data volume) > as well as keep constant (independent of data volume) > object allocation, or at least adjust "new generation" > size to handle peak loads (in case you insist for some > reason on creating object "new T()" for each event.
You still haven't provided anything to back this up. No demonstration, no reference.
|
|