Marco Manyevere wrote:
> In one test I did a couple of months back, I found that appending IDs
to the end of a dynamic array perfomed _much_ _much_ slower than a
WRITESEQ to the end of a disk file and the dynamic array wasnt even a
100 000 records long. We were able to reduce the time required to
produce a report from over 30 minutes to less than 2 minutes by removing
the dynamic array operations and replacing them with WRITESEQs. We tried
all the different syntaxes of appending to the array with no noticeable
difference in poor performance once the array got large.


Quick test on my development PC, on unidata 7.1

Source:

BIG.REC = ""
FOR ZEROS = 1 TO 10
  RUN.TO = 1:STR("0",ZEROS)
  BIG.REC = ""
  START.TIME = SYSTEM(12)
  FOR A = 1 TO RUN.TO
    BIG.REC<-1> = "test string"
  NEXT A
  END.TIME = SYSTEM(12)
  CRT RUN.TO:" iterations = ":END.TIME - START.TIME)"MR2,":" ms
":((END.TIME-START.TIME)/RUN.TO):" ms per iteration"
NEXT ZEROS


Output:

10 iterations = 1 ms  0.1 ms per iteration            
100 iterations = 0 ms  0 ms per iteration             
1000 iterations = 0 ms  0 ms per iteration            
10000 iterations = 3 ms  0.0003 ms per iteration      
100000 iterations = 34 ms  0.0003 ms per iteration    
1000000 iterations = 363 ms  0.0004 ms per iteration  
10000000 iterations = 3710 ms  0.0004 ms per iteration
Error when attaching shm (-1476392888, 0, 0), errno=8

The above does show that <-1> gives fast appending and that there isn't
much of a penalty as sizes increase. The only issue would be running out
of memory :-)

This seems fast to me - is it totally out of line with your tests?

Ed

-------------------------------------------------------------------------------------------
Please remember to recycle wherever possible. 
Reduce, reuse, recycle, think do you need to print this e-mail?
-------------------------------------------------------------------------------------------
This e-mail and any attachment(s), is confidential and may be legally 
privileged. It is intended solely for the addressee. If you are not the 
addressee, dissemination, copying or use of this e-mail or any of its content 
is prohibited and may be unlawful. If you are not the intended recipient please 
inform the sender immediately and destroy the e-mail, any attachment(s) and any 
copies. All liability for viruses is excluded to the fullest extent permitted 
by law. It is your responsibility to scan or otherwise check this email and any 
attachment(s). Unless otherwise stated (i) views expressed in this message are 
those of the individual sender (ii) no contract may be construed by this 
e-mail. Emails may be monitored and you are taken to consent to this 
monitoring.  

Civica Services Limited, Company No. 02374268; Civica UK Limited, Company No. 
01628868
Both companies are registered in England and Wales and each has its registered 
office at 2 Burston Road, Putney, London, SW15 6AR.
-------------------------------------------------------------------------------------------

_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to