I tried that method (styles 7 & 8) and got a longer time. Perhaps my test system isn't as fast (workload?) and as such, allowed the differences to be more pronounced. Here's my fastest version
DIM A(50000) ; MAT A="" FOR I=1 TO 50000 A(I)=I NEXT I B=A CONVERT 254 TO 253 IN B ;* LOWER (sic) Your method has 50000 (49,999) extraneous IF statements that I would have considered detrimental. I'll try it verbatim on the same system and get back to you. In case anyone cares about the system's workload, I tried each test several times in an out of sequence to post their average times. It ain't a virtual memory issue like years (decades) ago. Thanks. ----- Original Message ----- From: "Dzevad Dizdar" <[EMAIL PROTECTED]> To: <u2-users@listserver.u2ug.org> Sent: Monday, August 22, 2005 12:27 AM Subject: Re: [U2] REMOVE results as promised. > Hi Mark, > > There is another fast method to consider > > A="" > FOR I=1 TO 50000 > IF A = "" THEN > A := I > END ELSE > A := @VM : I > END > NEXT I > > It will take less then 1 second to finish on our system. > Dzevad > > ----- Original Message ----- > From: "Mark Johnson" <[EMAIL PROTECTED]> > To: <u2-users@listserver.u2ug.org> > Sent: Sunday, August 21, 2005 12:27 PM > Subject: [U2] REMOVE results as promised. > > > > As promised, here are the results of 9 different methods of appending. > > Basically program went like this: > > > > A="" > > FOR I=1 TO 50000 > > A<1,-1>=I > > NEXT I > > > > Style 1: <1,-1> > > straight.......................................................1 minute, > > 29 > > seconds > > Style 2: <-1> attribute level then CONVERT to > > 253...............................41 seconds > > Style 3: DIM(50,000), MATWRITE, READ & > > CONVERT.............................2 > > seconds > > Style 4: DIM(50,000), then assign to variable and CONVERT to > > 253............1 > > second > > Style 5: Target = null, [] > > replacing........................................................40 > > seconds > > Style 6: Target=Space(1000000), [] replacing then TRIM........8 minutes, > > 55 > > seconds. > > Style 7: Append, VM assigned inside > > loop..............................................41 seconds > > Style 8: Append, VM assigned outside loop then remove > > last..................34 > > seconds. > > Style 9: <1,MV> with MV+=MV as pointer.............................1 > > minute, > > 28 seconds > > > > 60 user D3 system on W2000 during normal business day. > > > > It appears that Styles 3 & 4 escaped the suggestions and rose to the top. > > Apparently the CONVERT (or RAISE/LOWER) functions are pretty quick. The > > DIM is > > incredibly quick. > > > > I learned a lot and hope others can as well. > > Thanks for everyone's suggestions. > > Mark Johnson > > > > If anyone wants further coding for any of the styles then don't hestitate > > to > > ask. > > ------- > > u2-users mailing list > > u2-users@listserver.u2ug.org > > To unsubscribe please visit http://listserver.u2ug.org/ > ------- > u2-users mailing list > u2-users@listserver.u2ug.org > To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/