Is it possible to declare any method or portion of code as HotSpot, at compile time. So that it is executed as native code right from the begining. thanx
Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Joined: Jul 11, 2001
No. And it probably wouldn't even help, as the Hotspot engine not only observes wether some code is a hotspot, but also analyzes how that code typically gets used, so that it can perform certain optimizations based on that data. Why do you want to?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Joined: Sep 28, 2002
thanx for the response, the reason why i wanted to that was, in my application i have to frequently read/write on local files. just to increase performance i was wondering if i cn declare that methods as hotspot.
Joined: Nov 22, 2008
In your particular case "read/write on local files", hotspot or jit compilation doesn't help you much. Reading/writing files are cans of slimey worms where disk caches, internal buffers, I/O speed etc. rear their ugly heads. All you can do is desing your algorithms properly so these slimey worms can be circumvented as much as possible, i.e. think about buffered I/O, buffer sizes etc. etc. kind regards