prefetch memory in java

Started by
3 comments, last by timmy2 17 years, 11 months ago
Hi I am looking for a fanction in java 5 that will prefatch a selected object, does anyone knows such function? Thanks
Advertisement
You could try calling an operation on it, for example equals().
The compiler will try to do this for you when it's worth the bother.

But Java is a high-level language, meaning that stuff like this is abstracted away, so you're supposed to just let the compiler/CPU deal with stuff like this. [wink]

The only thing you can do is like Fred304 suggested, to use the object. Then it has to be loaded into CPU cache, and it's effectively "prefetched".
Java doesn't have functions. Java has only methods.
I asume you don't know the correct term, because prefetch is often used in a meaning tell CPU to async grab something from memory that would be used 15 cycles later.

Assembly commands are outlawed in Java.
thanks all
I assumed that java don't have this abilty, you can find such abilty in C++,
by the way java compiler does the optimization only after it's check which method took the longest.

This topic is closed to new replies.

Advertisement