Removing intrinsic of Thread.isInterrupted() (original) (raw)

Aleksey Shipilev aleksey.shipilev at oracle.com
Tue Feb 25 10:05:46 PST 2014


Hi Yumin,

On 02/25/2014 09:25 PM, Yumin Qi wrote:

Thanks for the info, I modified as

Ok, if you still wish to go for hand-rolled benchmarks:

final int NUM = 20000; boolean interrupts[] = new boolean[NUM]; start = System.currentTimeMillis(); for (int j = 0; j < 100; j++) { for (int i = 0; i < NUM; i++) { interrupts[i] = t.isInterrupted(); } } finish = System.currentTimeMillis(); osum = finish - start; System.out.println(NUM + " calls cost: " + osum + " ms");

So, this benchmark still suffers from:

The result showed no difference (even a little better without intrinsic).

...and that begs the question, right? Why does it happen? Why the performance is similar for seemingly different code paths? Is intrinsic not working whatsoever? Is the experiment correct? Do we actually measure it right, etc?

I think I can remove it from hotspot.

I don't think we can, until we understand the performance implications through and through.

Thanks, -Aleksey.



More information about the hotspot-compiler-dev mailing list