Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Calling methods affects performance....

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic