Sign in to follow this  

prefetch memory in java

This topic is 4246 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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".

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4246 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this