Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Drawbacks of using too many function calls?
#2
Solved: 10 Years, 8 Months, 3 Weeks ago
I would say performance is affected. When you call a function there is a hit on the memory QTP utilizes. You call multiple functions and then heap of memory is under consideration. This affects performance in turn slows down the execution if memory management is not performed well.

I wouldnt say if you write a 1000 functions, the performance is hit. It would matter if you had not released the objects you create accordingly. Moreover, optimization is what is required for you.
Say, you have 100 objects on the screen. When you begin, if you write one function which creates all of the objects and you have operation to be performed only on say 10 objects. In this case, all of the 100 objects are first initalized and then operation on 10 objects is performed. Isint it useless to create 90 more objects? So, break it down. Create multiple functions for each of the screen attributes you have. For eg: IF you are automating Gmail, you create objects for Inbox in a function and then sent mail in a different function or probably New email objects in one function and so on and so forth. This way you can optimize and cause a less hit on the memory and improve the performance.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Messages In This Thread
RE: Drawbacks of using too many function calls? - by basanth27 - 02-14-2013, 08:14 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calling a Function in Function Library when function is defined in an Action jitenderkkr 0 2,769 11-27-2014, 12:53 PM
Last Post: jitenderkkr
  RegisterUserFunc fails when one calls another Archens 2 2,648 08-23-2012, 10:34 PM
Last Post: Archens
  Testing web Application that makes AJAX calls pendri 2 3,793 05-24-2011, 02:36 PM
Last Post: surya_7mar
  How can I fetch server time using function Now or any other function? blanchedsouza 2 4,837 11-07-2009, 08:34 PM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 1 Guest(s)