The 'extra' time when calling as a function is likely due to the assignment of the result to a variable. Doing that a million times has to trigger a significant number of garbage collects.
Perhaps You could modify the test to call the routine and 'copy' the result argument to a variable - it should IMHO result in a time about the same as the function call... -- mats David Wolverton skrev:
Actually - I just ran a test, and was surprised somewhat: 1,000,000 Iterations of ways to do a call... CALL PROGNAME (direct) 7047 CALL *PROGNAME (global) 7766 CALL @PROGNAME (indirect) 6984 GOSUB (logic contained in-line) 1531 Call as Function 10203 I've rearranged the order the routines are called in, and run the test suite over and over... The Indirect calls are CLEARLY faster, with all numbers moving +/- 50, EXCEPT the indirect, which only moved +/- 25 or so. Note that I set the @PROGNAME outside of the "call" loop - this was not testing how fast the system could set variables - just the difference on the 'calls'. If I include the setting of the name WITHIN the loop, the indirect call went to 7290 or so -- the difference in the 'direct' call vs the 'indirect' call efficiency appears to be in the Variable handling! But both are still faster than use of Global catalogs. Anyone have a clue why the indirects are a hair faster? Or am I just getting lucky over and over? I always thought they were slower as well! DW
------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/