This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Compiler Optimisation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compiler Optimisation" Watch "Compiler Optimisation" New topic
Author

Compiler Optimisation

Shiveen Pandita
Greenhorn

Joined: Jul 30, 2012
Posts: 25

It's been really informative to read everyone's replies. Yes I finally found it's some compiler optimization for the "if(Boolean)... " construct, otherwise compiler would have warned me that local variable has not been initialised.

One last thing though would be great to know...

are there any more such compiler optimization's that java uses to loop around such discrepancies.
Gaurangkumar Khalasi
Ranch Hand

Joined: Jun 02, 2012
Posts: 186
novice retard wrote:are there any more such compiler optimization's that java uses to loop around such discrepancies.

You can search if you want to know more about the code optimization(some example of it are as following) by the compiler:
1). Loop Optimization2). Dead code elimination
and many more...
Shiveen Pandita
Greenhorn

Joined: Jul 30, 2012
Posts: 25

@Gaurangkumar khalasi
@Campbell Ritchie
@Okti Wmcijewski

thanks.. you were great help. I'll be posting more questions.

I hope that all you guys will share your knowledge next time also like this.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38025
    
  22
Shiveen Pandita wrote:It's been really informative to read everyone's replies.
You’re welcome
Yes I finally found it's some compiler optimization . . .

are there any more such compiler optimization's that java uses to loop around such discrepancies.
Most optimisation is actually carried out by the runtime, particularly if it finds the same code being executed repreately (I think ≥10000×).

Since the topic of this discussion has changed and looks very interesting, I am going to split part of this thread into a new thread and call it “Compiler Optimisation” or similar
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38025
    
  22
This thread split from this old thread, where anybody wanting to see the earlier discussion can look.
Gaurangkumar Khalasi
Ranch Hand

Joined: Jun 02, 2012
Posts: 186
Shiveen Pandita wrote:thanks.. you were great help. I'll be posting more questions.

You are welcome
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compiler Optimisation
 
Similar Threads
Abstract method query
2 questions from Mock Exams.
Can a call to a static method made if its Object is pointing to null
Re: Java Import Statement
Byte