Click to See Complete Forum and Search --> : Function vs. COM


fgingras
January 12th, 2000, 10:51 PM
I have a function with 15 parameters which I have to call often.

Does having as many parameters slow execution too much? Is it worth it to write a COM object?

Johnny101
January 13th, 2000, 03:42 PM
If you turn that one function into a COM object, then you have to create the COM object each time you call it (unless you declare it's variable global). In either case, you will still have to pass the 15 parameters to the object. If you were to turn those parameters into properties of the COM object, then you'd have to make an additional 15 calls to the object, decreasing the efficiency of the object.

In my opinion, no don't convert it. Rather, see if there is any way you can cut down on the number of parameters being passed. Is there any way to derive one of the values from any of the other values being passed?

Hope this helps a little,

John

John Pirkey
MCSD
www.ShallowWaterSystems.com