On Jul 29, 2010, at 9:03 AM, Casper Bang wrote:

>> My instinct tells me that this is yet another naive attempt at 
>> benchmarking....
> 
> But if Alan identified a performance trouble area, then surely he's
> can't do anything else than what he is doing... trial-n-error under
> simulated conditions (acceptance tests). We can't all be Brian Goetz
> and walking around with intricate detail of the internals of the JVM.

Nonsense.. :-) You may not understand what is going on but that doesn't mean 
it's not deterministic, very very deterministic. One doesn't need to have all 
the internal details of the JVM to write a decent benchmark. You just need to 
know a few simple concepts. There is a profiler that execution model or our 
application. When a portion of the model is properly developed, the profiler 
tells the JIT to compile the code. In the process, it looks for common patterns 
in the execution model that it can optimize. Optimizations often involve a 
reorganization of the code. Do I know what those patterns are? Nope! Do I care? 
I might but.... often I don't. I just want it to happen and I want to make sure 
that I'm making measurements when it's all done. But that's common with every 
bench... I want to work through the startup phase before I measure. To do that 
I can tell the JIT to log compilation. If the JIT stops logging, you're 
finished warming up and it's time to measure. If I *need* to know how the JIT 
has treated my code, I'll ask the it to dump assembler. If you don't know how 
to do these things, you need to investigate and learn (like Brian has) or you 
simply shouldn't be benchmarking. And thats ok, benchmarking is not for 
everyone. I don't write GUI code and probably never should ;-)

I wouldn't use Unsafe but for corner cases in specific instances. However one 
could use AtomicReference which uses Unsafe or the equivalent in other 
environments. But that's typically not so easy so you're right, there is no 
spoon.

Regards,
Kirk

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to