File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Performance and the fly likes Is there a performace impact for those ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Is there a performace impact for those ?" Watch "Is there a performace impact for those ?" New topic

Is there a performace impact for those ?

Costa lamona
Ranch Hand

Joined: Sep 24, 2006
Posts: 102

Is there a performance bad effect for those keywords?

Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

Each of these are used for different functionalities. I dont see a way how these statements would affect the performance in any way. Any reason why you are trying to figure out the performance impact of these 3 control statements?

[My Blog] [JavaRanch Journal]
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

The use of break and continue is frowned upon more because it makes for confusing code than for any performance issues.
You can't avoid using return. Every method has to return some time or another. There is also a rule of thumb that one should not return anywhere but the end of the method because it is difficult to find return statements buried in code and can confuse readers.

[How To Ask Questions On JavaRanch]
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

When you talk about performance impacts, you must always be comparing two options. You can't say something is "better" without saying what it is better than.

Now, for example, what are you comparing "return" to? Not returning? The other thing you must always consider when comparing the performance of two options is that the two options must be doing the same thing. Otherwise your comparison is worthless.
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 862
In any real application this would not be a bottleneck, and so you will find most developers won't know much about the performance characteristics of the keywords you mention. Even if there was a difference it likely would be different between VM's, and versions of the jdk. - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
I agree. Here's the link:
subject: Is there a performace impact for those ?
It's not a secret anymore!