Jump to content
IGNORED

So, what about strings?


Recommended Posts

1 minute ago, jnharmon said:

I used a slightly different technique for storing the lengths of the substrings.

 

Instead of storing a separate array of the lengths, I prefixed each substring with a byte containing the length of the substring (this works as long as you limit substring length to less than 256 bytes).  To find the length of the substring, you just look at the value of the first byte at it's starting location.  The actual substring starts on the byte after that.  This reduces the storage for the length from 6 bytes per substring down to 1 byte.

In this case, you still need one index array for the staring pointer in order to sort the data, but that is a big improvement.
If you are using the array for packed strings to print, you *should* be able to set the negative bit for the last character in the string, and then just subtract 128 to print that character.  Works well from assembly, but BASIC...  IDK

 

Link to comment
Share on other sites

FWIW, I think you can get away with using 1.33 instead of 1.3 for the value of F, but there may be cases where that sort code doesn't completely sort the data if the number is too large.

This version is a little better, and matches the comb sort examples closer.
Using larger values for F won't fail, but you'll have more passes on a gap of 1 if F is too large.
 

Spoiler

1 Q=1:F=1.33:P=F:G=INT(N/P):FORT=1TO0STEP0:T=0:PRINT"PASS =";Q;"GAP =";G
2 FORI=1TON-G:IFA$(B(I))>A$(B(I+G))THENT=B(I):B(I)=B(I+G):B(I+G)=T
3 NEXTI:H=P:Q=Q+1:P=P*F:G=INT(N/P):IFG<1THENG=1
5 NEXTT:RETURN

*edit*
This will fail if any pass has no swaps. (?)

Edited by JamesD
Link to comment
Share on other sites

3 hours ago, JamesD said:

In this case, you still need one index array for the staring pointer in order to sort the data, but that is a big improvement.
If you are using the array for packed strings to print, you *should* be able to set the negative bit for the last character in the string, and then just subtract 128 to print that character.  Works well from assembly, but BASIC...  IDK

 

My technique did not produced packed arrays.  I used it to experiment with database type functions where the string stored an array of records, with records containing a set of fields each of a specified max length.  This produced records of constant size.  The length prefix was to have an immediate knowledge of the actual (not defined) length of each string without having to search for a string terminator.  My goal was to find techniques to overcome with lack of 2D string arrays which are very useful for database type applications.

 

I've attached a listing of the code I used.  This was of course very quick and dirty.

2darray.txt

  • Like 1
Link to comment
Share on other sites

1 hour ago, jnharmon said:

My technique did not produced packed arrays.  I used it to experiment with database type functions where the string stored an array of records, with records containing a set of fields each of a specified max length.  This produced records of constant size.  The length prefix was to have an immediate knowledge of the actual (not defined) length of each string without having to search for a string terminator.  My goal was to find techniques to overcome with lack of 2D string arrays which are very useful for database type applications.

 

I've attached a listing of the code I used.  This was of course very quick and dirty.

2darray.txt 3.77 kB · 5 downloads

An ATR with the program from the listing...

ARRAY2D.atr

  • Like 1
Link to comment
Share on other sites

15 hours ago, jnharmon said:

Instead of storing a separate array of the lengths, I prefixed each substring with a byte containing the length of the substring

Indeed, there are many ways of implementing string handling in ATARI BASIC, some of which have already been explored in this thread, but there are more!

 

Each has certain advantages/disadvantages depending on the interaction of various factors such as requirements and constraints of the task in hand, speed, memory economy, legibility of code etc. etc. One not mentioned so far which is slow and difficult to implement and has little going for it in ATARI BASIC is zero-terminated strings, where the length is defined by the first CHR$(0).

 

Although a different means of termination would make more sense in ATASCII, where (depending on context) CHR$(0) might actually be a valid string character (heart graphic).

Edited by drpeter
Link to comment
Share on other sites

As has been previously pointed out, the MC-10 came out years after the Atari.
The Apple II Plus would be more of what the Atari was up against, and here is it completing the sort of the larger list of names.


And here is the Plus/4.  Another 1.77MHz machine, though the interpreter is really slow due to the extended memory support.
I made a test patch for the Plus/4, and got a 5% speedup on the first try, so with a little work, it *should* offer pretty competitive times... just not with the standard BASIC.  It would be at the cost of available program, and variable storage space though.

 

 

Link to comment
Share on other sites

I tried a couple different variations of the sort.  They are very similar except for one small detail... instead of a divide, one only uses a multiply.
The idea was to use multiply because they are faster than divide. 
Speed is very dependent on what constant you use for F.
 

Spoiler

'O contains 1, and Z contains 0 because that's faster on MS BASIC, the main program starts on line 20
0 I=0:G=I:N=I:C=I:D=I:E=I:NW=I:H=I:T=I:O=1:Z=0:GOTO20


'using multiply
1 Q=O:F=.21:G=INT(N/1.3):FORT=OTOZSTEPZ:T=0:PRINT"PASS =";Q;"GAP =";G
2 FORI=OTON-G:IFA$(B(I))>A$(B(I+G))THENT=B(I):B(I)=B(I+G):B(I+G)=T
3 NEXT:Q=Q+O:G=INT(G-G*F):IFG<OTHENG=O
'4 IFG>1THENT=1
5 NEXT:RETURN

'using divide

'1 Q=O:F=1.3:P=F:G=INT(N/P):FORT=OTOZSTEPZ:T=0:PRINT"PASS =";Q;"GAP =";G
'2 FORI=OTON-G:IFA$(B(I))>A$(B(I+G))THENT=B(I):B(I)=B(I+G):B(I+G)=T
'3 NEXT:Q=Q+O:P=P*F:G=INT(N/P):IFG<OTHENG=O
''4 IFG>1THENT=1
'5 NEXT:RETURN
 

 

Link to comment
Share on other sites

On 7/26/2019 at 9:19 PM, dmsc said:

Hi!

Yes, this is how it currently works.

 

I started to implement the idea of "small string arrays", my idea was having support for this:


DIM NAMES$(891,30)  ' Array of 892 strings of max 30 characters, uses 892 * 31 = 27652 bytes

OPEN #1, 4, 0, "D:NAMES.TXT"
FOR I=1 TO 800
  INPUT #1, NAMES$(I)
NEXT I

 

Tee idea is that internally the data is stored as a contiguous array of bytes. To make this work, I would need to add three new tokens, "COPY_SHORT_STR", "CAT_SHORT_STR" and "INDEX_SHORT_STR", perhaps the current ones could be modified to reuse the code. But the main problem is that the interpreter would need some place to store the array stride (31 in the example), currently arrays are simply pointers to the first element, and the parser knows from the variable type the size of each element. As with this syntax the size would be variable, it would need to be kept at runtime.

 

Another possibility is only allowing the string size to be a constant, and making the parser keep the value in the parsing tables. This would make the parser more complicated (the variable table would need space for the size) but the runtime faster and simpler.

 

At the end, I did not implement the above as nobody has requested this feature, I think that for the main use cases of FastBasic (writing games or simple apps) this is not really that useful. 

 

If somebody came with a good use-case for short-strings (or two dimensional arrays, they present the same kind of problems), I don't think I would implement it. Remember that another feature of FastBasic is that the full IDE uses less than 8KB!

 

Have Fun!

 

I would keep it simple.

 

Just add support for ONE (1)-byte string arrays of (max) 16 bits length. In other words, linear arrays in which each cell holds ONE char, being the array's max. length any from 0 to 32767 or 65535 (unsigned).

 

There will be a penalty for arbitrary-length single-string conversion and decomposition into char-for-char (byte-for-byte) array, but once performed, most related operations on that array should FLY like an eagle on F-Basic, due to support of true integers!

Link to comment
Share on other sites

On 7/27/2019 at 6:29 PM, drpeter said:

(…) And here we're deliberately disadvantaging ATARI BASIC by focusing on a task it's not best suited for. Altirra BASIC is faster than ATARI BASIC- in this instance it does the actual sort in ~50 mins vs 80 mins with no fast OS patches activated.

 

(…)

 

  Reveal hidden contents

0 DIM K$(50),N$(5457):DIM S$(1784),O$(1782):POKE 752,1:DIM A$(4),B$(1),CLS$(1):GOTO 45
1 K=K*2+1:Z=INT(Y/256):S$(K,K)=CHR$(Z):S$(K+1,K+1)=CHR$(Y-Z*256):RETURN 
2 K=K*2+1:Y=ASC(S$(K))*256+ASC(S$(K+1)):RETURN 
3 K=K*2+1:Z=INT(Y/256):O$(K,K)=CHR$(Z):O$(K+1,K+1)=CHR$(Y-Z*256):RETURN 
4 K=K*2+1:Y=ASC(O$(K))*256+ASC(O$(K+1)):RETURN 
5 X=X+1:? B$;A$(X,X);:IF X=4 THEN X=0:REM BUSY CURSOR
6 RETURN 
10 P=1:F=1.3:G=1:L=0:REM SORT SUBROUTINE
13 L=L+1:P=P*F:G=INT(N/P):IF G<1 THEN G=1
14 NW=N-G:? "PASS ";L;" GAP ";G;"  ";:IF G=1 THEN S=1
15 FOR I=0 TO NW-1:K=I:GOSUB 4:Q=Y:K=Y:GOSUB 2:S1=Y:K=Q+1:GOSUB 2:F1=Y-1
16 K=I+G:GOSUB 4:Q=Y:K=Y:GOSUB 2:S2=Y:K=Q+1:GOSUB 2:F2=Y-1
18 IF N$(S1,F1)<=N$(S2,F2) THEN GOTO 20
19 K=I:GOSUB 4:T=Y:K=I+G:GOSUB 4:K=I:GOSUB 3:K=I+G:Y=T:GOSUB 3:S=0
20 GOSUB 5:REM BUSY CURSOR
21 NEXT I:IF S=1 THEN RETURN 
22 ? B$:GOTO 13
25 ? : ? "CHECKING SORT...  ";:R=0:FOR I=0 TO N-2:REM CHECK SORT ORDER ROUTINE
26 K=I:GOSUB 4:Q=Y:K=Y:GOSUB 2:S1=Y:K=Q+1:GOSUB 2:F1=Y-1
27 K=I+1:GOSUB 4:Q=Y:K=Y:GOSUB 2:S2=Y:K=Q+1:GOSUB 2:F2=Y-1
29 IF N$(S1,F1)>N$(S2,F2) THEN ? "OUT OF ORDER ";N$(S1,F1):R=1
30 GOSUB 5:NEXT I:? B$;:IF R=0 THEN ? "OK";
32 ? : ? :RETURN 
40 FOR I=0 TO N-1:K=I:GOSUB 4:Q=Y:K=Y:GOSUB 2:S1=Y:K=Q+1:GOSUB 2:F1=Y-1
42 ? N$(S1,F1);" ";:NEXT I:RETURN 
44 REM MAIN
45 N=0:A$(1)=CHR$(22):A$(2)=CHR$(13):A$(3)=CHR$(2):A$(4)=CHR$(14):B$=CHR$(126):CLS$=CHR$(125)
51 REM K$=TEMP,N$=NAME ARRAY,S$=SUBSTRING START PTRS,O$=SORT SEQUENCE
52 REM A$=CHARACTERS FOR BUSY CURSOR
53 REM B$=BACKSPACE, CLS$=CLEAR SCREEN, POKE 752,1 =SYSTEM CURSOR OFF
55 ? CLS$:? "COMB SORT MOST POPULAR SURNAMES":? : ? "LOADING DATA...  ";
60 READ K$,C,D,E:IF K$="$$$$" THEN GOTO 70
61 GOSUB 5:REM BUSY CURSOR ROUTINE
62 K=N:Y=LEN(N$)+1:GOSUB 1:N$(LEN(N$)+1)=K$:L=L+LEN(K$):K=N:Y=N:GOSUB 3:N=N+1:GOTO 60
70 K=N:Y=LEN(N$)+1:GOSUB 1:? B$:? N;" NAMES LOADED":? "TOTAL LENGTH ";L;" BYTES":? 
86 TT=PEEK(20)+PEEK(19)*256+PEEK(18)*256*256
88 GOSUB 10:? B$:REM SORT ROUTINE
89 IF PEEK(20)>200 THEN GOTO 89
90 TT=PEEK(20)+PEEK(19)*256+PEEK(18)*256*256-TT
91 GOSUB 25:REM CHECK SORT ORDER
92 GOSUB 40:REM PRINT SORTED LIST
96 ? : ? : ?"SORT TOOK ";INT(TT/50);" SECONDS"
98 ? : ? "DONE":POKE 752,0:END 
100 DATA SMITH,2501922,1.006,1,JOHNSON,2014470,.81,2,WILLIAMS,1738413,.699,3
101 DATA JONES,1544427,.621,4,BROWN,1544427,.621,5,DAVIS,1193760,.48,6
102 DATA MILLER,1054488,.424,7,WILSON,843093,.339,8,MOORE,775944,.312,9
103 DATA TAYLOR,773457,.311,10,ANDERSON,773457,.311,11,THOMAS,773457,.311,12
104 DATA JACKSON,770970,.31,13,WHITE,693873,.279,14,HARRIS,683925,.275,15
105 DATA MARTIN,678951,.273,16,THOMPSON,669003,.269,17,GARCIA,631698,.254,18
106 DATA MARTINEZ,581958,.234,19,ROBINSON,579471,.233,20,CLARK,574497,.231,21
107 DATA RODRIGUEZ,569523,.229,22,LEWIS,562062,.226,23,LEE,547140,.22,24
108 DATA WALKER,544653,.219,25,HALL,497400,.2,26,ALLEN,494913,.199,27
109 DATA YOUNG,479991,.193,28,HERNANDEZ,477504,.192,29,KING,472530,.19,30
110 DATA WRIGHT,470043,.189,31,LOPEZ,465069,.187,32,HILL,465069,.187,33
111 DATA SCOTT,460095,.185,34,GREEN,455121,.183,35,ADAMS,432738,.174,36
112 DATA BAKER,425277,.171,37,GONZALEZ,412842,.166,38,NELSON,402894,.162,39
113 DATA CARTER,402894,.162,40,MITCHELL,397920,.16,41,PEREZ,385485,.155,42
114 DATA ROBERTS,380511,.153,43,TURNER,378024,.152,44,PHILLIPS,370563,.149,45
115 DATA CAMPBELL,370563,.149,46,PARKER,363102,.146,47,EVANS,350667,.141,48
116 DATA EDWARDS,340719,.137,49,COLLINS,333258,.134,50,STEWART,330771,.133,51
117 DATA SANCHEZ,323310,.13,52,MORRIS,310875,.125,53,ROGERS,305901,.123,54
118 DATA REED,303414,.122,55,COOK,298440,.12,56,MORGAN,293466,.118,57
119 DATA BELL,290979,.117,58,MURPHY,290979,.117,59,BAILEY,286005,.115,60
120 DATA RIVERA,281031,.113,61,COOPER,281031,.113,62,RICHARDSON,278544,.112,63
121 DATA COX,273570,.11,64,HOWARD,273570,.11,65,WARD,268596,.108,66
122 DATA TORRES,268596,.108,67,PETERSON,266109,.107,68,GRAY,263622,.106,69
123 DATA RAMIREZ,261135,.105,70,JAMES,261135,.105,71,WATSON,256161,.103,72
124 DATA BROOKS,256161,.103,73,KELLY,253674,.102,74,SANDERS,248700,.1,75
125 DATA PRICE,246213,.099,76,BENNETT,246213,.099,77,WOOD,243726,.098,78
126 DATA BARNES,241239,.097,79,ROSS,238752,.096,80,HENDERSON,236265,.095,81
127 DATA COLEMAN,236265,.095,82,JENKINS,236265,.095,83,PERRY,233778,.094,84
128 DATA POWELL,231291,.093,85,LONG,228804,.092,86,PATTERSON,228804,.092,87
129 DATA HUGHES,228804,.092,88,FLORES,228804,.092,89,WASHINGTON,228804,.092,90
130 DATA BUTLER,226317,.091,91,SIMMONS,226317,.091,92,FOSTER,226317,.091,93
131 DATA GONZALES,216369,.087,94,BRYANT,216369,.087,95,ALEXANDER,211395,.085,96
132 DATA RUSSELL,211395,.085,97,GRIFFIN,208908,.084,98,DIAZ,208908,.084,99
133 DATA HAYES,206421,.083,100,MYERS,206421,.083,101,FORD,203934,.082,102
134 DATA HAMILTON,203934,.082,103,GRAHAM,203934,.082,104,SULLIVAN,201447,.081,105
135 DATA WALLACE,201447,.081,106,WOODS,198960,.08,107,COLE,198960,.08,108
136 DATA WEST,198960,.08,109,JORDAN,193986,.078,110,OWENS,193986,.078,111
137 DATA REYNOLDS,193986,.078,112,FISHER,191499,.077,113,ELLIS,191499,.077,114
138 DATA HARRISON,189012,.076,115,GIBSON,186525,.075,116,MCDONALD,186525,.075,117
139 DATA CRUZ,186525,.075,118,MARSHALL,186525,.075,119,ORTIZ,186525,.075,120
140 DATA GOMEZ,186525,.075,121,MURRAY,184038,.074,122,FREEMAN,184038,.074,123
141 DATA WELLS,181551,.073,124,WEBB,179064,.072,125,SIMPSON,174090,.07,126
142 DATA STEVENS,174090,.07,127,TUCKER,174090,.07,128,PORTER,171603,.069,129
143 DATA HUNTER,171603,.069,130,HICKS,171603,.069,131,CRAWFORD,169116,.068,132
144 DATA HENRY,169116,.068,133,BOYD,169116,.068,134,MASON,169116,.068,135
145 DATA MORALES,166629,.067,136,KENNEDY,166629,.067,137,WARREN,166629,.067,138
146 DATA DIXON,164142,.066,139,RAMOS,164142,.066,140,REYES,164142,.066,141
147 DATA BURNS,161655,.065,142,GORDON,161655,.065,143,SHAW,161655,.065,144
148 DATA HOLMES,161655,.065,145,RICE,159168,.064,146,ROBERTSON,159168,.064,147
149 DATA HUNT,156681,.063,148,BLACK,156681,.063,149,DANIELS,154194,.062,150
150 DATA PALMER,154194,.062,151,MILLS,151707,.061,152,NICHOLS,149220,.06,153
151 DATA GRANT,149220,.06,154,KNIGHT,149220,.06,155,FERGUSON,146733,.059,156
152 DATA ROSE,146733,.059,157,STONE,146733,.059,158,HAWKINS,146733,.059,159
153 DATA DUNN,144246,.058,160,PERKINS,144246,.058,161,HUDSON,144246,.058,162
154 DATA SPENCER,141759,.057,163,GARDNER,141759,.057,164,STEPHENS,141759,.057,165
155 DATA PAYNE,141759,.057,166,PIERCE,139272,.056,167,BERRY,139272,.056,168
156 DATA MATTHEWS,139272,.056,169,ARNOLD,139272,.056,170,WAGNER,136785,.055,171
157 DATA WILLIS,136785,.055,172,RAY,136785,.055,173,WATKINS,136785,.055,174
158 DATA OLSON,136785,.055,175,CARROLL,136785,.055,176,DUNCAN,136785,.055,177
159 DATA SNYDER,136785,.055,178,HART,134298,.054,179,CUNNINGHAM,134298,.054,180
160 DATA BRADLEY,134298,.054,181,LANE,134298,.054,182,ANDREWS,134298,.054,183
161 DATA RUIZ,134298,.054,184,HARPER,134298,.054,185,FOX,131811,.053,186
162 DATA RILEY,131811,.053,187,ARMSTRONG,131811,.053,188,CARPENTER,131811,.053,189
163 DATA WEAVER,131811,.053,190,GREENE,131811,.053,191,LAWRENCE,129324,.052,192
164 DATA ELLIOTT,129324,.052,193,CHAVEZ,129324,.052,194,SIMS,129324,.052,195
165 DATA AUSTIN,129324,.052,196,PETERS,129324,.052,197,KELLEY,129324,.052,198
166 DATA FRANKLIN,126837,.051,199,LAWSON,126837,.051,200,FIELDS,126837,.051,201
167 DATA GUTIERREZ,126837,.051,202,RYAN,126837,.051,203,SCHMIDT,126837,.051,204
168 DATA CARR,126837,.051,205,VASQUEZ,126837,.051,206,CASTILLO,126837,.051,207
169 DATA WHEELER,126837,.051,208,CHAPMAN,124350,.05,209,OLIVER,124350,.05,210
170 DATA MONTGOMERY,121863,.049,211,RICHARDS,121863,.049,212,WILLIAMSON,121863,.049,213
171 DATA JOHNSTON,121863,.049,214,BANKS,119376,.048,215,MEYER,119376,.048,216
172 DATA BISHOP,119376,.048,217,MCCOY,119376,.048,218,HOWELL,119376,.048,219
173 DATA ALVAREZ,119376,.048,220,MORRISON,119376,.048,221,HANSEN,116889,.047,222
174 DATA FERNANDEZ,116889,.047,223,GARZA,116889,.047,224,HARVEY,116889,.047,225
175 DATA LITTLE,114402,.046,226,BURTON,114402,.046,227,STANLEY,114402,.046,228
176 DATA NGUYEN,114402,.046,229,GEORGE,114402,.046,230,JACOBS,114402,.046,231
177 DATA REID,114402,.046,232,KIM,111915,.045,233,FULLER,111915,.045,234
178 DATA LYNCH,111915,.045,235,DEAN,111915,.045,236,GILBERT,111915,.045,237
179 DATA GARRETT,111915,.045,238,ROMERO,111915,.045,239,WELCH,109428,.044,240
180 DATA LARSON,109428,.044,241,FRAZIER,109428,.044,242,BURKE,109428,.044,243
181 DATA HANSON,106941,.043,244,DAY,106941,.043,245,MENDOZA,106941,.043,246
182 DATA MORENO,106941,.043,247,BOWMAN,106941,.043,248,MEDINA,104454,.042,249
183 DATA FOWLER,104454,.042,250,BREWER,104454,.042,251,HOFFMAN,104454,.042,252
184 DATA CARLSON,104454,.042,253,SILVA,104454,.042,254,PEARSON,104454,.042,255
185 DATA HOLLAND,104454,.042,256,DOUGLAS,101967,.041,257,FLEMING,101967,.041,258
186 DATA JENSEN,101967,.041,259,VARGAS,101967,.041,260,BYRD,101967,.041,261
187 DATA DAVIDSON,101967,.041,262,HOPKINS,101967,.041,263,MAY,99480,.04,264
188 DATA TERRY,99480,.04,265,HERRERA,99480,.04,266,WADE,99480,.04,267
189 DATA SOTO,99480,.04,268,WALTERS,99480,.04,269,CURTIS,99480,.04,270
190 DATA NEAL,96993,.039,271,CALDWELL,96993,.039,272,LOWE,96993,.039,273
191 DATA JENNINGS,96993,.039,274,BARNETT,96993,.039,275,GRAVES,96993,.039,276
192 DATA JIMENEZ,96993,.039,277,HORTON,96993,.039,278,SHELTON,96993,.039,279
193 DATA BARRETT,96993,.039,280,OBRIEN,96993,.039,281,CASTRO,96993,.039,282
194 DATA SUTTON,94506,.038,283,GREGORY,94506,.038,284,MCKINNEY,94506,.038,285
195 DATA LUCAS,94506,.038,286,MILES,94506,.038,287,CRAIG,94506,.038,288
196 DATA RODRIQUEZ,92019,.037,289,CHAMBERS,92019,.037,290,HOLT,92019,.037,291
197 DATA LAMBERT,92019,.037,292,FLETCHER,92019,.037,293,WATTS,92019,.037,294
198 DATA BATES,92019,.037,295,HALE,92019,.037,296,RHODES,92019,.037,297
199 DATA PENA,92019,.037,298,BECK,92019,.037,299,NEWMAN,89532,.036,300
200 DATA HAYNES,89532,.036,301,MCDANIEL,89532,.036,302,MENDEZ,89532,.036,303
201 DATA BUSH,89532,.036,304,VAUGHN,89532,.036,305,PARKS,87045,.035,306
202 DATA DAWSON,87045,.035,307,SANTIAGO,87045,.035,308,NORRIS,87045,.035,309
203 DATA HARDY,87045,.035,310,LOVE,87045,.035,311,STEELE,87045,.035,312
204 DATA CURRY,87045,.035,313,POWERS,87045,.035,314,SCHULTZ,87045,.035,315
205 DATA BARKER,87045,.035,316,GUZMAN,84558,.034,317,PAGE,84558,.034,318
206 DATA MUNOZ,84558,.034,319,BALL,84558,.034,320,KELLER,84558,.034,321
207 DATA CHANDLER,84558,.034,322,WEBER,84558,.034,323,LEONARD,84558,.034,324
208 DATA WALSH,82071,.033,325,LYONS,82071,.033,326,RAMSEY,82071,.033,327
209 DATA WOLFE,82071,.033,328,SCHNEIDER,82071,.033,329,MULLINS,82071,.033,330
210 DATA BENSON,82071,.033,331,SHARP,82071,.033,332,BOWEN,82071,.033,333
211 DATA DANIEL,82071,.033,334,BARBER,79584,.032,335,CUMMINGS,79584,.032,336
212 DATA HINES,79584,.032,337,BALDWIN,79584,.032,338,GRIFFITH,79584,.032,339
213 DATA VALDEZ,79584,.032,340,HUBBARD,79584,.032,341,SALAZAR,79584,.032,342
214 DATA REEVES,79584,.032,343,WARNER,77097,.031,344,STEVENSON,77097,.031,345
215 DATA BURGESS,77097,.031,346,SANTOS,77097,.031,347,TATE,77097,.031,348
216 DATA CROSS,77097,.031,349,GARNER,77097,.031,350,MANN,77097,.031,351
217 DATA MACK,77097,.031,352,MOSS,77097,.031,353,THORNTON,77097,.031,354
218 DATA DENNIS,77097,.031,355,MCGEE,77097,.031,356,FARMER,74610,.03,357
219 DATA DELGADO,74610,.03,358,AGUILAR,74610,.03,359,VEGA,74610,.03,360
220 DATA GLOVER,74610,.03,361,MANNING,74610,.03,362,COHEN,74610,.03,363
221 DATA HARMON,74610,.03,364,RODGERS,74610,.03,365,ROBBINS,74610,.03,366
222 DATA NEWTON,74610,.03,367,TODD,74610,.03,368,BLAIR,74610,.03,369
223 DATA HIGGINS,74610,.03,370,INGRAM,74610,.03,371,REESE,74610,.03,372
224 DATA CANNON,74610,.03,373,STRICKLAND,74610,.03,374,TOWNSEND,74610,.03,375
225 DATA POTTER,74610,.03,376,GOODWIN,74610,.03,377,WALTON,74610,.03,378
226 DATA ROWE,72123,.029,379,HAMPTON,72123,.029,380,ORTEGA,72123,.029,381
227 DATA PATTON,72123,.029,382,SWANSON,72123,.029,383,JOSEPH,72123,.029,384
228 DATA FRANCIS,72123,.029,385,GOODMAN,72123,.029,386,MALDONADO,72123,.029,387
229 DATA YATES,72123,.029,388,BECKER,72123,.029,389,ERICKSON,72123,.029,390
230 DATA HODGES,72123,.029,391,RIOS,72123,.029,392,CONNER,72123,.029,393
231 DATA ADKINS,72123,.029,394,WEBSTER,69636,.028,395,NORMAN,69636,.028,396
232 DATA MALONE,69636,.028,397,HAMMOND,69636,.028,398,FLOWERS,69636,.028,399
233 DATA COBB,69636,.028,400,MOODY,69636,.028,401,QUINN,69636,.028,402
234 DATA BLAKE,69636,.028,403,MAXWELL,69636,.028,404,POPE,69636,.028,405
235 DATA FLOYD,67149,.027,406,OSBORNE,67149,.027,407,PAUL,67149,.027,408
236 DATA MCCARTHY,67149,.027,409,GUERRERO,67149,.027,410,LINDSEY,67149,.027,411
237 DATA ESTRADA,67149,.027,412,SANDOVAL,67149,.027,413,GIBBS,67149,.027,414
238 DATA TYLER,67149,.027,415,GROSS,67149,.027,416,FITZGERALD,67149,.027,417
239 DATA STOKES,67149,.027,418,DOYLE,67149,.027,419,SHERMAN,67149,.027,420
240 DATA SAUNDERS,67149,.027,421,WISE,67149,.027,422,COLON,67149,.027,423
241 DATA GILL,67149,.027,424,ALVARADO,67149,.027,425,GREER,64662,.026,426
242 DATA PADILLA,64662,.026,427,SIMON,64662,.026,428,WATERS,64662,.026,429
243 DATA NUNEZ,64662,.026,430,BALLARD,64662,.026,431,SCHWARTZ,64662,.026,432
244 DATA MCBRIDE,64662,.026,433,HOUSTON,64662,.026,434,CHRISTENSEN,64662,.026,435
245 DATA KLEIN,64662,.026,436,PRATT,64662,.026,437,BRIGGS,64662,.026,438
246 DATA PARSONS,64662,.026,439,MCLAUGHLIN,64662,.026,440,ZIMMERMAN,64662,.026,441
247 DATA FRENCH,64662,.026,442,BUCHANAN,64662,.026,443,MORAN,64662,.026,444
248 DATA COPELAND,62175,.025,445,ROY,62175,.025,446,PITTMAN,62175,.025,447
249 DATA BRADY,62175,.025,448,MCCORMICK,62175,.025,449,HOLLOWAY,62175,.025,450
250 DATA BROCK,62175,.025,451,POOLE,62175,.025,452,FRANK,62175,.025,453
251 DATA LOGAN,62175,.025,454,OWEN,62175,.025,455,BASS,62175,.025,456
252 DATA MARSH,62175,.025,457,DRAKE,62175,.025,458,WONG,62175,.025,459
253 DATA JEFFERSON,62175,.025,460,PARK,62175,.025,461,MORTON,62175,.025,462
254 DATA ABBOTT,62175,.025,463,SPARKS,62175,.025,464,PATRICK,59688,.024,465
255 DATA NORTON,59688,.024,466,HUFF,59688,.024,467,CLAYTON,59688,.024,468
256 DATA MASSEY,59688,.024,469,LLOYD,59688,.024,470,FIGUEROA,59688,.024,471
257 DATA CARSON,59688,.024,472,BOWERS,59688,.024,473,ROBERSON,59688,.024,474
258 DATA BARTON,59688,.024,475,TRAN,59688,.024,476,LAMB,59688,.024,477
259 DATA HARRINGTON,59688,.024,478,CASEY,59688,.024,479,BOONE,59688,.024,480
260 DATA CORTEZ,59688,.024,481,CLARKE,59688,.024,482,MATHIS,59688,.024,483
261 DATA SINGLETON,59688,.024,484,WILKINS,59688,.024,485,CAIN,59688,.024,486
262 DATA BRYAN,59688,.024,487,UNDERWOOD,59688,.024,488,HOGAN,59688,.024,489
263 DATA MCKENZIE,57201,.023,490,COLLIER,57201,.023,491,LUNA,57201,.023,492
264 DATA PHELPS,57201,.023,493,MCGUIRE,57201,.023,494,ALLISON,57201,.023,495
265 DATA BRIDGES,57201,.023,496,WILKERSON,57201,.023,497,NASH,57201,.023,498
266 DATA SUMMERS,57201,.023,499,ATKINS,57201,.023,500,WILCOX,57201,.023,501
267 DATA PITTS,57201,.023,502,CONLEY,57201,.023,503,MARQUEZ,57201,.023,504
268 DATA BURNETT,57201,.023,505,RICHARD,57201,.023,506,COCHRAN,57201,.023,507
269 DATA CHASE,57201,.023,508,DAVENPORT,57201,.023,509,HOOD,57201,.023,510
270 DATA GATES,57201,.023,511,CLAY,57201,.023,512,AYALA,57201,.023,513
271 DATA SAWYER,57201,.023,514,ROMAN,57201,.023,515,VAZQUEZ,57201,.023,516
272 DATA DICKERSON,57201,.023,517,HODGE,54714,.022,518,ACOSTA,54714,.022,519
273 DATA FLYNN,54714,.022,520,ESPINOZA,54714,.022,521,NICHOLSON,54714,.022,522
274 DATA MONROE,54714,.022,523,WOLF,54714,.022,524,MORROW,54714,.022,525
275 DATA KIRK,54714,.022,526,RANDALL,54714,.022,527,ANTHONY,54714,.022,528
276 DATA WHITAKER,54714,.022,529,OCONNOR,54714,.022,530,SKINNER,54714,.022,531
277 DATA WARE,54714,.022,532,MOLINA,54714,.022,533,KIRBY,54714,.022,534
278 DATA HUFFMAN,54714,.022,535,BRADFORD,54714,.022,536,CHARLES,54714,.022,537
279 DATA GILMORE,54714,.022,538,DOMINGUEZ,54714,.022,539,ONEAL,54714,.022,540
280 DATA BRUCE,54714,.022,541,LANG,52227,.021,542,COMBS,52227,.021,543
281 DATA KRAMER,52227,.021,544,HEATH,52227,.021,545,HANCOCK,52227,.021,546
282 DATA GALLAGHER,52227,.021,547,GAINES,52227,.021,548,SHAFFER,52227,.021,549
283 DATA SHORT,52227,.021,550,WIGGINS,52227,.021,551,MATHEWS,52227,.021,552
284 DATA MCCLAIN,52227,.021,553,FISCHER,52227,.021,554,WALL,52227,.021,555
285 DATA SMALL,52227,.021,556,MELTON,52227,.021,557,HENSLEY,52227,.021,558
286 DATA BOND,52227,.021,559,DYER,52227,.021,560,CAMERON,52227,.021,561
287 DATA GRIMES,52227,.021,562,CONTRERAS,52227,.021,563,CHRISTIAN,52227,.021,564
288 DATA WYATT,52227,.021,565,BAXTER,52227,.021,566,SNOW,52227,.021,567
289 DATA MOSLEY,52227,.021,568,SHEPHERD,52227,.021,569,LARSEN,52227,.021,570
290 DATA HOOVER,52227,.021,571,BEASLEY,49740,.02,572,GLENN,49740,.02,573
291 DATA PETERSEN,49740,.02,574,WHITEHEAD,49740,.02,575,MEYERS,49740,.02,576
292 DATA KEITH,49740,.02,577,GARRISON,49740,.02,578,VINCENT,49740,.02,579
293 DATA SHIELDS,49740,.02,580,HORN,49740,.02,581,SAVAGE,49740,.02,582
294 DATA OLSEN,49740,.02,583,SCHROEDER,49740,.02,584,HARTMAN,49740,.02,585
295 DATA WOODARD,49740,.02,586,MUELLER,49740,.02,587,KEMP,49740,.02,588
296 DATA DELEON,49740,.02,589,BOOTH,49740,.02,590,PATEL,49740,.02,591
297 DATA CALHOUN,49740,.02,592,WILEY,49740,.02,593,EATON,49740,.02,594
298 DATA CLINE,49740,.02,595,NAVARRO,49740,.02,596,HARRELL,49740,.02,597
299 DATA LESTER,49740,.02,598,HUMPHREY,49740,.02,599,PARRISH,49740,.02,600
300 DATA DURAN,49740,.02,601,HUTCHINSON,49740,.02,602,HESS,49740,.02,603
301 DATA DORSEY,49740,.02,604,BULLOCK,49740,.02,605,ROBLES,49740,.02,606
302 DATA BEARD,47253,.019,607,DALTON,47253,.019,608,AVILA,47253,.019,609
303 DATA VANCE,47253,.019,610,RICH,47253,.019,611,BLACKWELL,47253,.019,612
304 DATA YORK,47253,.019,613,JOHNS,47253,.019,614,BLANKENSHIP,47253,.019,615
305 DATA TREVINO,47253,.019,616,SALINAS,47253,.019,617,CAMPOS,47253,.019,618
306 DATA PRUITT,47253,.019,619,MOSES,47253,.019,620,CALLAHAN,47253,.019,621
307 DATA GOLDEN,47253,.019,622,MONTOYA,47253,.019,623,HARDIN,47253,.019,624
308 DATA GUERRA,47253,.019,625,MCDOWELL,47253,.019,626,CAREY,47253,.019,627
309 DATA STAFFORD,47253,.019,628,GALLEGOS,47253,.019,629,HENSON,47253,.019,630
310 DATA WILKINSON,47253,.019,631,BOOKER,47253,.019,632,MERRITT,47253,.019,633
311 DATA MIRANDA,47253,.019,634,ATKINSON,47253,.019,635,ORR,47253,.019,636
312 DATA DECKER,47253,.019,637,HOBBS,47253,.019,638,PRESTON,47253,.019,639
313 DATA TANNER,47253,.019,640,KNOX,47253,.019,641,PACHECO,47253,.019,642
314 DATA STEPHENSON,44766,.018,643,GLASS,44766,.018,644,ROJAS,44766,.018,645
315 DATA SERRANO,44766,.018,646,MARKS,44766,.018,647,HICKMAN,44766,.018,648
316 DATA ENGLISH,44766,.018,649,SWEENEY,44766,.018,650,STRONG,44766,.018,651
317 DATA PRINCE,44766,.018,652,MCCLURE,44766,.018,653,CONWAY,44766,.018,654
318 DATA WALTER,44766,.018,655,ROTH,44766,.018,656,MAYNARD,44766,.018,657
319 DATA FARRELL,44766,.018,658,LOWERY,44766,.018,659,HURST,44766,.018,660
320 DATA NIXON,44766,.018,661,WEISS,44766,.018,662,TRUJILLO,44766,.018,663
321 DATA ELLISON,44766,.018,664,SLOAN,44766,.018,665,JUAREZ,44766,.018,666
322 DATA WINTERS,44766,.018,667,MCLEAN,44766,.018,668,RANDOLPH,44766,.018,669
323 DATA LEON,44766,.018,670,BOYER,44766,.018,671,VILLARREAL,44766,.018,672
324 DATA MCCALL,44766,.018,673,GENTRY,44766,.018,674,CARRILLO,42279,.017,675
325 DATA KENT,42279,.017,676,AYERS,42279,.017,677,LARA,42279,.017,678
326 DATA SHANNON,42279,.017,679,SEXTON,42279,.017,680,PACE,42279,.017,681
327 DATA HULL,42279,.017,682,LEBLANC,42279,.017,683,BROWNING,42279,.017,684
328 DATA VELASQUEZ,42279,.017,685,LEACH,42279,.017,686,CHANG,42279,.017,687
329 DATA HOUSE,42279,.017,688,SELLERS,42279,.017,689,HERRING,42279,.017,690
330 DATA NOBLE,42279,.017,691,FOLEY,42279,.017,692,BARTLETT,42279,.017,693
331 DATA MERCADO,42279,.017,694,LANDRY,42279,.017,695,DURHAM,42279,.017,696
332 DATA WALLS,42279,.017,697,BARR,42279,.017,698,MCKEE,42279,.017,699
333 DATA BAUER,42279,.017,700,RIVERS,42279,.017,701,EVERETT,42279,.017,702
334 DATA BRADSHAW,42279,.017,703,PUGH,42279,.017,704,VELEZ,42279,.017,705
335 DATA RUSH,42279,.017,706,ESTES,42279,.017,707,DODSON,42279,.017,708
336 DATA MORSE,42279,.017,709,SHEPPARD,42279,.017,710,WEEKS,42279,.017,711
337 DATA CAMACHO,42279,.017,712,BEAN,42279,.017,713,BARRON,42279,.017,714
338 DATA LIVINGSTON,42279,.017,715,MIDDLETON,39792,.016,716,SPEARS,39792,.016,717
339 DATA BRANCH,39792,.016,718,BLEVINS,39792,.016,719,CHEN,39792,.016,720
340 DATA KERR,39792,.016,721,MCCONNELL,39792,.016,722,HATFIELD,39792,.016,723
341 DATA HARDING,39792,.016,724,ASHLEY,39792,.016,725,SOLIS,39792,.016,726
342 DATA HERMAN,39792,.016,727,FROST,39792,.016,728,GILES,39792,.016,729
343 DATA BLACKBURN,39792,.016,730,WILLIAM,39792,.016,731,PENNINGTON,39792,.016,732
344 DATA WOODWARD,39792,.016,733,FINLEY,39792,.016,734,MCINTOSH,39792,.016,735
345 DATA KOCH,39792,.016,736,BEST,39792,.016,737,SOLOMON,39792,.016,738
346 DATA MCCULLOUGH,39792,.016,739,DUDLEY,39792,.016,740,NOLAN,39792,.016,741
347 DATA BLANCHARD,39792,.016,742,RIVAS,39792,.016,743,BRENNAN,39792,.016,744
348 DATA MEJIA,39792,.016,745,KANE,39792,.016,746,BENTON,39792,.016,747
349 DATA JOYCE,39792,.016,748,BUCKLEY,39792,.016,749,HALEY,39792,.016,750
350 DATA VALENTINE,39792,.016,751,MADDOX,39792,.016,752,RUSSO,39792,.016,753
351 DATA MCKNIGHT,39792,.016,754,BUCK,39792,.016,755,MOON,39792,.016,756
352 DATA MCMILLAN,39792,.016,757,CROSBY,39792,.016,758,BERG,39792,.016,759
353 DATA DOTSON,39792,.016,760,MAYS,39792,.016,761,ROACH,39792,.016,762
354 DATA CHURCH,39792,.016,763,CHAN,39792,.016,764,RICHMOND,39792,.016,765
355 DATA MEADOWS,39792,.016,766,FAULKNER,39792,.016,767,ONEILL,39792,.016,768
356 DATA KNAPP,39792,.016,769,KLINE,37305,.015,770,BARRY,37305,.015,771
357 DATA OCHOA,37305,.015,772,JACOBSON,37305,.015,773,GAY,37305,.015,774
358 DATA AVERY,37305,.015,775,HENDRICKS,37305,.015,776,HORNE,37305,.015,777
359 DATA SHEPARD,37305,.015,778,HEBERT,37305,.015,779,CHERRY,37305,.015,780
360 DATA CARDENAS,37305,.015,781,MCINTYRE,37305,.015,782,WHITNEY,37305,.015,783
361 DATA WALLER,37305,.015,784,HOLMAN,37305,.015,785,DONALDSON,37305,.015,786
362 DATA CANTU,37305,.015,787,TERRELL,37305,.015,788,MORIN,37305,.015,789
363 DATA GILLESPIE,37305,.015,790,FUENTES,37305,.015,791,TILLMAN,37305,.015,792
364 DATA SANFORD,37305,.015,793,BENTLEY,37305,.015,794,PECK,37305,.015,795
365 DATA KEY,37305,.015,796,SALAS,37305,.015,797,ROLLINS,37305,.015,798
366 DATA GAMBLE,37305,.015,799,DICKSON,37305,.015,800,BATTLE,37305,.015,801
367 DATA SANTANA,37305,.015,802,CABRERA,37305,.015,803,CERVANTES,37305,.015,804
368 DATA HOWE,37305,.015,805,HINTON,37305,.015,806,HURLEY,37305,.015,807
369 DATA SPENCE,37305,.015,808,ZAMORA,37305,.015,809,YANG,37305,.015,810
370 DATA MCNEIL,37305,.015,811,SUAREZ,37305,.015,812,CASE,37305,.015,813
371 DATA PETTY,37305,.015,814,GOULD,37305,.015,815,MCFARLAND,37305,.015,816
372 DATA SAMPSON,37305,.015,817,CARVER,37305,.015,818,BRAY,37305,.015,819
373 DATA ROSARIO,37305,.015,820,MACDONALD,37305,.015,821,STOUT,37305,.015,822
374 DATA HESTER,37305,.015,823,MELENDEZ,37305,.015,824,DILLON,37305,.015,825
375 DATA FARLEY,37305,.015,826,HOPPER,37305,.015,827,GALLOWAY,37305,.015,828
376 DATA POTTS,37305,.015,829,BERNARD,37305,.015,830,JOYNER,34818,.014,831
377 DATA STEIN,34818,.014,832,AGUIRRE,34818,.014,833,OSBORN,34818,.014,834
378 DATA MERCER,34818,.014,835,BENDER,34818,.014,836,FRANCO,34818,.014,837
379 DATA ROWLAND,34818,.014,838,SYKES,34818,.014,839,BENJAMIN,34818,.014,840
380 DATA TRAVIS,34818,.014,841,PICKETT,34818,.014,842,CRANE,34818,.014,843
381 DATA SEARS,34818,.014,844,MAYO,34818,.014,845,DUNLAP,34818,.014,846
382 DATA HAYDEN,34818,.014,847,WILDER,34818,.014,848,MCKAY,34818,.014,849
383 DATA COFFEY,34818,.014,850,MCCARTY,34818,.014,851,EWING,34818,.014,852
384 DATA COOLEY,34818,.014,853,VAUGHAN,34818,.014,854,BONNER,34818,.014,855
385 DATA COTTON,34818,.014,856,HOLDER,34818,.014,857,STARK,34818,.014,858
386 DATA FERRELL,34818,.014,859,CANTRELL,34818,.014,860,FULTON,34818,.014,861
387 DATA LYNN,34818,.014,862,LOTT,34818,.014,863,CALDERON,34818,.014,864
388 DATA ROSA,34818,.014,865,POLLARD,34818,.014,866,HOOPER,34818,.014,867
389 DATA BURCH,34818,.014,868,MULLEN,34818,.014,869,FRY,34818,.014,870
390 DATA RIDDLE,34818,.014,871,LEVY,34818,.014,872,DAVID,34818,.014,873
391 DATA DUKE,34818,.014,874,ODONNELL,34818,.014,875,GUY,34818,.014,876
392 DATA MICHAEL,34818,.014,877,BRITT,34818,.014,878,FREDERICK,34818,.014,879
393 DATA DAUGHERTY,34818,.014,880,BERGER,34818,.014,881,DILLARD,34818,.014,882
394 DATA ALSTON,34818,.014,883,JARVIS,34818,.014,884,FRYE,34818,.014,885
395 DATA RIGGS,34818,.014,886,CHANEY,34818,.014,887,ODOM,32331,.013,888
396 DATA DUFFY,32331,.013,889,FITZPATRICK,32331,.013,890,VALENZUELA,32331,.013,891
1000 DATA $$$$,0,0,0
1001 REM END OF DATA

 

 

EIGHTY (80) minutes "down to" FIFTY (50) mins?

 

Talk about an monumental ode to inefficiency. (not the sample code prepared for Atari Basic, but the designed task and data-structure chosen for such interpreter).

 

I will check all this and work on the Atari-Basic samples, over the next few days...

 

Link to comment
Share on other sites

On ‎7‎/‎27‎/‎2019 at 11:58 AM, JamesD said:

Even though the Atari clock speed is higher, plus your version doesn't scan the data to find out how large the array is, and after I removed the busy indicator... standard MS BASIC on the MC-10 beats it. 
I ran the test on Altirra 3.1, with Altirra BASIC.  Loading the array was pretty fast, but the sort... not so much. 

Oh, and pasting the text into the Altirra emulator is excruciatingly slow.  It takes about 15 seconds to load the original program on VMC-10.
I might be able to make coffee with the Atari.   Is there a faster way to enter the program?

Here's how it compares as written.  Keep in mind that the Atari code is unoptimized, and even dropping the busy indicator makes a noticeable difference, so don't worry too much about this version being slower.  Standard MS BASIC is also closer to the speed of the Atari.
I guess I should worry about how the output of mine looks... it's kinda ugly in comparison.  In my defense, it was a quick n dirty test.



 

 

Results for 300 names:

 

63.10 to 63.33 secs on Atari 800 / Incognito, and {Altirra Basic 1.56 + Altirra FP pack} (all sitting exactly-and-residing on 16KB + 8KB rom space, with absolutely NO compromise of original ROM functionality).

 

Attached is DOS 2.5 bootable (130K) .ATR with Atari Basic source code (minimal optimizations), system ROMs (for Incognito and Ultimate, to be extracted for Altirra or simply to be flashed from U-Flash on your Incognito / Ultimate).

 

Should complete the full list in about 3.5 mins or so, if RAM space would not be so wasted with float-arrays.

 

Scratchpad-DOS-130K-II.ATR

Edited by Faicuai
Updated .ATR with Altirra Basic 1.56 ROM
Link to comment
Share on other sites

Hi,

 

1 hour ago, Faicuai said:

63.10 to 63.33 secs on Atari 800 / Incognito, and {Altirra Basic 1.56 + Altirra FP pack} (all sitting exactly-and-residing on 16KB + 8KB rom space, with absolutely NO compromise of original ROM functionality).

Not sure where all this is heading and for what purpose?

 

Atari benchmarks can be speeded up by patching the OS, using a faster non-stock BASIC, turning off screen DMA and altering the original task by limiting it to 300 names. Or in particular running Altirra or some other emulator at warp speed.

 

No surprises about any of this.

 

Any of a number of varieties of BASIC, OS, hardware enhancements in various combinations will give different benchmarks.  But therefore so what?  Stock ATARI BASIC is very slow in most benchmarks compared to contemporary stock machines and furthermore not suited to a task like this that would greatly benefit from integer or string arrays/arithmetic.  This is all well known and a consequence of some trade-offs made and the lack of optimisations for speed when designing the stock software, not much to do with the hardware.

 

If ATARI BASIC (which does nevertheless have some redeeming features) doesn't suit the task in hand, there are numerous alternate languages or BASICs (or even OSs) freely available to choose from, any of which is likely to run faster than stock ATARI in most contexts, often considerably so and particularly if offering the salient features absent from ATARI BASIC. I suspect for example that compiled Turbo BASIC XL would comfortably beat the benchmarks you mention- but what does that prove? Just that I've changed the 'rules of the game' by introducing the possibility of a compiled executable.

 

This all started as a fun proof-of-concept that the full task (of comb sorting exactly the 891 names presented with a load of extraneous numeric data as in-line DATA statements) could indeed be implemented, albeit slowly, with only stock ATARI BASIC, OS and hardware and no USR functions. Those were my self-imposed 'rules of the game', in line with the challenge posed by the thread creator.

 

Changing all those basic assumptions risks ending up merely as the rather bland observation that this is a machine with a 6502 running at  1.79 MHz with performance to match.

 

The challenge you have set yourself seems to be a rather different one, which is to find what speed improvement can be achieved with a patched ROM and a non-stock BASIC but within the constraints of near-full compatibility with stock OS and BASIC and hardware, but accepting running a cut-down task (300 names only)...  If those are the parameters, probably not a bad idea to try other OS patches and BASICs too and see which gives the best results. Or even languages different to BASIC- why not?

Edited by drpeter
  • Like 2
Link to comment
Share on other sites

okay so why not use all three official 'Stock' Atari Basics? and compare them all were on cartridge and/or disk.

So Atari BASIC, ATARI Microsoft BASIC 1, and Atari Microsoft BASIC 2.

Why not write the code and optimize it to work towards each of their affinities?

Try to get each one to execute the entirety of the list and as quickly as possible... that should be fun challenge.

I looked up sorts of the past and there is mention of DATA locations and direction of sort speeding things up in Atari BASIC among many of things. It would require some reading to brush up on what would be needed... it's still pretty impressive when coming up against all the later machines, the different cpus with built in ram and other optimizations on the other machines as well, that the Atari manages to pull it off. After all the optimization and catering to the Atari's affinities, it's nice to know you can still get that much more out of things by killing the display and other such moves to really get things rolling as a standard method without any hacks of the OS etc..

  • Like 1
Link to comment
Share on other sites

39 minutes ago, drpeter said:

Hi,

 

Not sure where all this is heading and for what purpose?

 

Atari benchmarks can be speeded up by patching the OS, using a faster non-stock BASIC, turning off screen DMA and altering the original task by limiting it to 300 names. Or in particular running Altirra or some other emulator at warp speed.

 

No surprises about any of this.

 

Any of a number of varieties of BASIC, OS, hardware enhancements in various combinations will give different benchmarks.  But therefore so what?  Stock ATARI BASIC is very slow in most benchmarks compared to contemporary stock machines and furthermore not suited to a task like this that would greatly benefit from integer or string arrays/arithmetic.  This is all well known and a consequence of some trade-offs made and the lack of optimisations for speed when designing the stock software, not much to do with the hardware.

 

If ATARI BASIC (which does nevertheless have some redeeming features) doesn't suit the task in hand, there are numerous alternate languages or BASICs (or even OSs) freely available to choose from, any of which is likely to run faster than stock ATARI in most contexts, often considerably so and particularly if offering the salient features absent from ATARI BASIC. I suspect for example that compiled Turbo BASIC XL would comfortably beat the benchmarks you mention- but what does that prove? Just that I've changed the 'rules of the game' by introducing the possibility of a compiled executable.

 

This all started as a fun proof-of-concept that the full task (of comb sorting exactly the 891 names presented with a load of extraneous numeric data as in-line DATA statements) could indeed be implemented, albeit slowly, with only stock ATARI BASIC, OS and hardware and no USR functions. Those were my self-imposed 'rules of the game', in line with the challenge posed by the thread creator.

 

Changing all those basic assumptions risks ending up merely as the rather bland observation that this is a machine with a 6502 running at  1.79 MHz with performance to match.

 

The challenge you have set yourself seems to be a rather different one, which is to find what speed improvement can be achieved with a patched ROM and a non-stock BASIC but within the constraints of near-full compatibility with stock OS and BASIC and hardware, but accepting running a cut-down task (300 names only)...  If those are the parameters, probably not a bad idea to try other OS patches and BASICs too and see which gives the best results. Or even languages different to BASIC- why not?

 

The challenge on hand is the same as defined from the beginning:

 

Running a sort routine (which is fed from in-line data statements instead of storage-files !), by using Atari Basic's STRING FUNCTIONS and HANDLING.

 

Multiple versions of Basic interpreters have been already mentioned here, besides Atari Basic... including Altirra Basic and MS Basic itself, which comes in two different flavors for the Atari. Don't ask me any questions about Atari-basic versions (ask them to those that already brought them to the picture!)

 

The above results clearly suggest a 3.0mins to 3.5mins execution time for a full names-list (assuming RAM is not wasted due to useless float arrays), down from 50 to 80 MINUTES, and beating EVERY single implementation mentioned here (!!!) That is TWENTY TIMES faster, and still within Interpreter domain and dialect, and still same CPU, etc.! 

 

In summary, there is no such deviation from the intended test, here. 

 

Edited by Faicuai
Link to comment
Share on other sites

OK, Perhaps we could set a choice of 2 fun challenges:

 

1) Implement the full 891 name sort in stock ATARI BASIC, including all the extraneous in-line data within a unitary program, to run on Altirra 3.20: XL NTSC/64K/BASIC (rev. C) at normal speed.

2) Implement the full 891 name sort as above but using any interpreted BASIC you like, alongside any stock-compatible OS patches you like, to be run on Altirra 3.20: XL NTSC/320K at normal speed.

 

In either case, time to be taken from the start of the actual sort routine (after any set-up, pre-loading of unsorted data into arrays, array initialisations etc.) to the completion of the sort, before any checking of the sort accuracy or reporting of results.

 

Suspending hardware and OS functions not necessary to the task is permissible in case 2 but not in case 1- so no turning off of DMA, interrupts etc. in case 1.

 

Let the games begin!

 

Link to comment
Share on other sites

1 minute ago, Faicuai said:

The above results clearly suggest a 3.0mins to 3.5mins execution time for a full names-list (assuming RAM is not wasted due to useless float arrays), down from 50 to 80 MINUTES, and beating EVERY single implementation mentioned here (!!!) That is TWENTY TIMES faster, and still within Interpreter domain, and still same CPU, etc.!

Not quite, for 2 reasons:

 

i) The sort time does not increase linearly with the number of names to be sorted, so the estimate of 3.0-3.5 minutes for an 891 name sort  is way out even with your code and firmware choices

ii) Fitting the 891 names into available RAM unfortunately requires (at least to my mind) changes to the code to get rid of floating point arrays which slows everything down very considerably

 

So, not at all comparing like with like, I'm afraid

Link to comment
Share on other sites

1 minute ago, drpeter said:

OK, Perhaps we could set a choice of 2 fun challenges:

 

1) Implement the full 891 name sort in stock ATARI BASIC, including all the extraneous in-line data within a unitary program, to run on Altirra 3.20: XL NTSC/64K/BASIC (rev. C) at normal speed.

2) Implement the full 891 name sort as above but using any interpreted BASIC you like, alongside any stock-compatible OS patches you like, to be run on Altirra 3.20: XL NTSC/320K at normal speed.

 

In either case, time to be taken from the start of the actual sort routine (after any set-up, pre-loading of unsorted data into arrays, array initialisations etc.) to the completion of the sort, before any checking of the sort accuracy or reporting of results.

 

Suspending hardware and OS functions not necessary to the task is permissible in case 2 but not in case 1- so no turning off of DMA, interrupts etc. in case 1.

 

Let the games begin!

 

 

All you are saying is that you want to DELIBERATELY set Atari's CPU to a full -40% effective speed, for reasons that have nothing to do with Atari Basic.

 

In fact, I propose that EVERYONE here shuts off their screen-updates when running the test. EVERY machine, EVERY interpreter!!!

Link to comment
Share on other sites

8 minutes ago, drpeter said:

Not quite, for 2 reasons:

 

i) The sort time does not increase linearly with the number of names to be sorted, so the estimate of 3.0-3.5 minutes for an 891 name sort  is way out even with your code and firmware choices

ii) Fitting the 891 names into available RAM unfortunately requires (at least to my mind) changes to the code to get rid of floating point arrays which slows everything down very considerably

 

So, not at all comparing like with like, I'm afraid

Not a problem, either...

 

Right on the video posted here (vis-a-vis), the faster implementation completes in 1m:30secs, or about 90 secs. The Atari is already running it @ 63.1 secs... and we have not yet attempted any structural optimization of the Basic code...)

 

Any non-linear execution time-line will only BALLOON that difference!

Edited by Faicuai
Link to comment
Share on other sites

4 minutes ago, Faicuai said:

All you are saying is that you want to DELIBERATELY set Atari's CPU to a full -40% effective speed, for reasons that have nothing to do with Atari Basic.

 

I was thinking more along the lines of the 'Keep It Simple Stupid' challenge (1) vs the '(Almost) anything goes challenge (2).

 

It's not that important, but it seems to me that you mainly want recognition that the Atari's clock speed is 1.79 MHz, even though in practice this is never realised except in somewhat artificial circumstances where the user is happy to be left staring at a blank screen :-)

  • Like 1
Link to comment
Share on other sites

17 minutes ago, drpeter said:

 

I was thinking more along the lines of the 'Keep It Simple Stupid' challenge (1) vs the '(Almost) anything goes challenge (2).

 

It's not that important, but it seems to me that you mainly want recognition that the Atari's clock speed is 1.79 MHz, even though in practice this is never realised except in somewhat artificial circumstances where the user is happy to be left staring at a blank screen ?

Wrong!

 

The attached .ROMs on my ATR allow turning ON and OFF Antic, AT WILL, outside of Basic, because this function is dormant and supported right at OS-Level, since 1982/1983, all the way to XEGS (v04) ROM.

 

You can test by simply setting ANTIC=1 on source list attached, and then hitting "CTRL-{Atari/Inverse}" on 800 or XL. You can turn back on screen on-the-fly by simply touching a key...

 

Turning off screen is a FEATURE on Atari, and it is used and supported in multiple other SW packages. Nothing wrong to have your CPU working at full TILT just because we want it and whenever we want it! ;-)

 

As a said before: Let's level the playfield and have ANY OTHER test / machine / interpreter shut off their screens as well !!!

Edited by Faicuai
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...