Hi, I have a screen where i will give one input field, based on this field i'll populate 10 fields.In this 10 fields most of them involve calculations.I'll have method where i'll query the database for that input field.When i get the value, say i'm getting one value, again i should query another table for this fields(Which i got from preevious query) adn then calculate it and set it in a bean.My question is calling a method from another method often causes performance hindrance or not.. Thx in Adv Senthil
posted 13 years ago
My question is calling a method from another method often causes performance hindrance or not..
If I'm reading this question correctly, you're asking if there is a performance hit associated with calling one method from another. First, calling one method from another is essential to all but the simplest programs. I doubt you'll be able to do anything useful without it. Second, there may be a significant performance hit, depending on the definitions of the methods. For instance, if the calling method calls another method from within a big for loop, you might see the performance drop. With that said, you cannot begin to worry about performance until you have set service levels (i.e. this method must complete in 2 ms.) I recommend you write the code first, and if you find it isn't fast enough, refactor it. HTH, Jason