Jump to content
  • Advertisement
Sign in to follow this  
timmy2

prefetch memory in java

This topic is 4460 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

Hi I am looking for a fanction in java 5 that will prefatch a selected object, does anyone knows such function? Thanks

Share this post


Link to post
Share on other sites
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!