Hi,

A direct call has to be looked up once in the catalogue system when it is first 
used. Subsequent calls will be fast because the link
has been created. However, if the call is itself in a subroutine and that 
subroutine exits, it starts clean again on next call and
hence may need to rebuild the link. I say "may need to" because there are 
various layers of caching that speed all this up.

An indirect call starts out with a string variable. The first call will do the 
catalogue search, link the program, and replace the
string with a variable that acts as a fast link to the subroutine. The link 
only needs to be rebuilt if the variable is overwritten
or discarded. This means that putting the indirection variable in a common 
block that is only initialised once will do the catalogue
search only once. Resetting the variable (local or common) before every call 
will require the search every time, though again
caching may help.

Long ago, I did some performance comparisons on UV when delivering an Internals 
course. I have lost the results but I seem to recall
that it was well worth using links in common for subroutines that are called 
enormous numbers of times.


Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200




-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of David A. Green
Sent: 04 December 2012 14:01
To: 'U2 Users List'
Subject: Re: [U2] Advantage of indirect call in BASIC

Does anyone have any current benchmarks on this type of call?  Several years
ago when I tested it in UniData it was very slow call compared to using the
name.

David A. Green
(480) 813-1725
DAG Consulting

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson
Sent: Monday, December 03, 2012 5:39 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] Advantage of indirect call in BASIC

I've not encountered this is my career previously, but now I'm seeing a
system written almost entirely with the use of indirect calls in Universe
BASIC.

That is
SOURCE = "*SOME.PROGRAM"
...
CALL @SOURCE(INPUTS)

Is there some advantage to the use of indirect calls that a system would be
written entirely in this fashion?


_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to