Jeff,

        UV/UD do not keep track of which multi-value was last accessed.
Only the attribute.  Each iteration of the For-Next had to start
counting from the beginning of attribute 1 according to your notes
below.  If you re-run your test with FOR/NEXT/<I> (instead of <1,I>) you
should see a significant improvement in the For-Next time.

--Ron P. 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Saturday, April 16, 2005 9:53 PM
To: [email protected]
Subject: Re: [U2] Clarification on FOR...NEXT loops

Taking advice from others on this list, I wrote a small program to
compare the execution time of extracting 10000 elements from an MV list
using FOR/NEXT loop with <1,I> delimiters verus using LOOP/WHILE with
REMOVE.  I should note this was done on Unidata 6.0.3.

All the previous comments are still valid - the LOOP/WHILE with REMOVE
beats a FOR/NEXT loop dramatically.  That is, on an MV list with 10000
elements, FOR/NEXT took about 6500 milliseconds while LOOP/WHILE took 15
milliseconds (that's not a typo).

I ran the test 10+ times, I reversed the order of the tests and the
result was the same every time.

So if you need to loop over all elements in an MV list, the
LOOP/WHILE/REMOVE structure seems inherently more efficient than the
FOR/NEXT/<1,I> notation.

Jeff Butera, Ph.D.
Administrative Systems
Hampshire College
[EMAIL PROTECTED]
413-559-5556

"...our behavior matters more than the beliefs that we profess."
                                Elizabeth Deutsch Earle
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to