05-17-2006, 05:36 AM
Antoni, Just a thought.
Here's your getform FUNCTION:
FUNCTION getform
FOR j = 0 TO maxi
GET #1,,s1(j)
IF EOF(1) THEN EXIT FOR
NEXT
IF j =< maxi THEN getform = j-1 ELSE getform = maxi
END FUNCTION
It looks like you will read one long variable into s1(j) 16k times. Since the unsort file is 4MB, using this function you will perform 1 million reads (gets) from the file. Won't this slow down the whole process? Isn't there a way you could read some larger chunks, like maybe 4000 bytes, to reduce the number of reads down to 1000?
Of course you would have to parse these chunks in 4 byte increments and convert each 4 bytes to a long variable, and then store them into the s1 array. Would this be difficult? Assuming you have an extra 4000 bytes in your program's memory, wouldn't that increase the speed?
*****
Here's your getform FUNCTION:
FUNCTION getform
FOR j = 0 TO maxi
GET #1,,s1(j)
IF EOF(1) THEN EXIT FOR
NEXT
IF j =< maxi THEN getform = j-1 ELSE getform = maxi
END FUNCTION
It looks like you will read one long variable into s1(j) 16k times. Since the unsort file is 4MB, using this function you will perform 1 million reads (gets) from the file. Won't this slow down the whole process? Isn't there a way you could read some larger chunks, like maybe 4000 bytes, to reduce the number of reads down to 1000?
Of course you would have to parse these chunks in 4 byte increments and convert each 4 bytes to a long variable, and then store them into the s1 array. Would this be difficult? Assuming you have an extra 4000 bytes in your program's memory, wouldn't that increase the speed?
*****