Re: optimizeit: how to workaround/minimize wrong cput time in Object.wait()

From: NOBODY (antispam_at_0.0.0.0)
Date: 11/10/04


Date: Wed, 10 Nov 2004 13:35:34 GMT

It is definitly an optimizeit limitation.
OI 6 gives the same ***.
Jprobe doesn't.
The weird YourKitProfiler doesn't.
I will try good old fashion sun's hprof today (just because this one is
free... and may be more of a reference...)

>Then are you satisfied with the throughput?
No. And I'm just trying to apply the 80%-20% rule.
Once optimized, I should see code in the hotspots, not wait()!
I have never seen that before, ever, in 6 years.
Modern pc's are probably too fast for optimizeit approach of profiling.
Note that in instrumentation mode, OI gave me substackframes under wait
()!
Like wait called my other methods! (probably those methods that ran
between the 2 wait)... I want my money back! hehehe!

> I did a small test where I increased overall wait time by sleeping
> before the notify and wait didn't even show up in the profiler results
> (with -Xrunhprof). Probably testing another profiler is best you can
> do at the moment.

You have to notify more, not less.
You want to cause the waiting thread wait to exit, do a quick job and go
back to wait, so that the OI profiler thinks no other method/line of code
was running but thread was not blocked.

> Since this seems to affect only one place in the code, did you
> consider instrumenting the code with measurements of your own? You
> could have a wait counter and a wait time counter and thus determine
> average wait time.

System.currentTimeMillis is only ms, not nanoseconds...!

Allright, Thanks Robert.
I will report a bug to borland... if at all possible...
Have a good week.


Quantcast