I just did a test of this on Universe 10 on Windows 7 and it doesn't make any 
difference

FFT.BP 'SPEED.TEST'
0001       GOSUB SUB.ONE
0002       GOSUB SUB.TWO
0003 *
0004       GOSUB SUB.TWO
0005       GOSUB SUB.ONE
0006       STOP
0007 *
0008 SUB.ONE:
0009       START = TIME()
0010       A = ''
0011       FOR I = 1 TO 500000
0012          A<-1> = I
0013       NEXT I
0014       FINISH = TIME()
0015       ELAPSE = FINISH - START
0016       DISPLAY ELAPSE:' SECONDS'
0017       RETURN
0018 *
0019 SUB.TWO:
0020       START = TIME()
0021       A = ''
0022       FOR I = 1 TO 500000
0023          A := @AM:I
0024       NEXT I
0025       FINISH = TIME()
0026       ELAPSE = FINISH - START
0027       DISPLAY ELAPSE:' SECONDS'
0028       RETURN
0029 *
0030    END

Results

2.657 SECONDS
2.734 SECONDS
2.703 SECONDS
2.563 SECONDS

I did each routine twice as you can see, flipping the order to eliminate any 
possibility of caching having an effect.


-----Original Message-----
From: Dave Laansma <dlaan...@hubbardsupply.com>
To: U2 Users List <u2-users@listserver.u2ug.org>
Sent: Thu, Jul 12, 2012 7:59 am
Subject: Re: [U2] trimming a list (a test of your ability)


Is this technique significantly faster? It still has to search to the end of 
the 
able each time it appends this string, doesn't it?
Sincerely,
avid Laansma
T Manager
ubbard Supply Co.
irect: 810-342-7143
ffice: 810-234-8681
ax: 810-234-6142
ww.hubbardsupply.com
Delivering Products, Services and Innovative Solutions"

----Original Message-----
rom: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] 
n Behalf Of George Gallen
ent: Thursday, July 12, 2012 9:30 AM
o: U2 Users List
ubject: Re: [U2] trimming a list (a test of your ability)
Instead of <-1>, use  string=string:char(254):additionalelement
George
-----Original Message-----
rom: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] 
n Behalf Of Dave Laansma
ent: Thursday, July 12, 2012 9:20 AM
o: Marco Manyevere; U2 Users List
ubject: Re: [U2] trimming a list (a test of your ability)
This is the best solution, using REMOVE and building a new list instead of 
onstantly 'shrinking' the original table.
That being said, as NEW.LIST gets rather large, adding new elements to it can 
et 'time' consuming. Just like the REMOVE keeps track of the pointer as you 
pin through a table, I wish there was a comparable statement that kept track of 
he pointer as we added new elements <-1> to tables.
Sincerely,
avid Laansma
T Manager
ubbard Supply Co.
irect: 810-342-7143
ffice: 810-234-8681
ax: 810-234-6142
ww.hubbardsupply.com
Delivering Products, Services and Innovative Solutions"
-----Original Message-----
rom: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] 
n Behalf Of Marco Manyevere
ent: Thursday, July 12, 2012 4:14 AM
o: U2 Users List
ubject: Re: [U2] trimming a list (a test of your ability)
Is this what the OP is asking about or I'm missing something? The 2 code 
ragments look totally different. We dont know what's happening in 
ET.UTILITY.RECORD or the significance of UTILITY.NAME and LAST.NAME to totally 
liminate them during the 'optimisation'
I would rather do:

EW.LIST = ''
OOP
 REMOVE UTILITY.ID FROM KEY.LIST SETTING MORE WHILE MORE:UTILITY.ID
 GOSUB GET.UTILITY.RECORD
  IF INDEX(UTILITY.NAME,LAST.NAME,1) = 0 THEN CONTINUE
  NEW.LIST<-1> = UTILITY.ID
EPEAT
EY.LIST = NEW.LIST
EW.LIST = '' ;* free the memory

________________________________
From: Kate Stanton <k...@walstan.com>
o: U2 Users List <u2-users@listserver.u2ug.org>
ent: Thursday, 12 July 2012, 4:27
ubject: Re: [U2] trimming a list (a test of your ability)
 
 am getting sucked in!
NLST = ""                                                       ;* For new list 
AXI = DCOUNT(KEY.LIST<1>,@vM)         ;* Count items FOR INO =1 TO MAXI        
                          ;* Each key in list
 KEY.ID = KEY.LIST<1,INO>                        ;* A key ID
 LOCATE(KEY.ID,NLST,1;POS;'AL') ELSE  ;* see if there
   INS KEY.ID BEFORE NLIST<1,POS>       ;* Sort to list
 END
EXT INO                                                      ;* Check all keys 
n 12 July 2012 12:09, Wjhonson <wjhon...@aol.com> wrote:
>
 1295          FOR DISPLAY.LOOP = 1 TO KEY.COUNT
 1296             UTILITY.ID = KEY.LIST<1,DISPLAY.LOOP>
 1297             GOSUB GET.UTILITY.RECORD
 1298             IF INDEX(UTILITY.NAME,LAST.NAME,1) = 0 THEN
 1299                KEY.LIST = DELETE(KEY.LIST,1,DISPLAY.LOOP,0)
 1300                DISPLAY.LOOP -= 1
 1301                KEY.COUNT -= 1
 1302             END
 1303          NEXT DISPLAY.LOOP


 Comments?


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


--
ate Stanton
alstan Systems Ltd
 Kelmarna Ave, Herne Bay, Auckland 1011, New Zealand
hone: + 64 9 360 5310  Mobile: + 64 21 400 486
mail: k...@walstan.com
______________________________________________
2-Users mailing list
2-us...@listserver.u2ug.org
ttp://listserver.u2ug.org/mailman/listinfo/u2-users
______________________________________________
2-Users mailing list
2-us...@listserver.u2ug.org
ttp://listserver.u2ug.org/mailman/listinfo/u2-users
______________________________________________
2-Users mailing list
2-us...@listserver.u2ug.org
ttp://listserver.u2ug.org/mailman/listinfo/u2-users
______________________________________________
2-Users mailing list
2-us...@listserver.u2ug.org
ttp://listserver.u2ug.org/mailman/listinfo/u2-users
______________________________________________
2-Users mailing list
2-us...@listserver.u2ug.org
ttp://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