Hi,
Why have negative effect to speed application used size of Array ?
In my program I have
DECLARE arow[20000000]
Then I use this arow to read lines from file in cycle
FOR i=1 to x
arow:=something...
NEXT
x can be 100000, 2.000.000 and so 20.000.000
If I declare to 2.000.000 program speed is about 3x speed then declare 20.000.000.
Can I set some dynamic declaration without set to fix number of array elements ?
Array size and speed application
-
- Posts: 36
- Joined: Thu Jan 28, 2010 2:30 pm
Re: Array size and speed application
Victorio wrote:Hi,
Why have negative effect to speed application used size of Array ?
In my program I have
DECLARE arow[20000000]
Then I use this arow to read lines from file in cycle
FOR i=1 to x
arow:=something...
NEXT
x can be 100000, 2.000.000 and so 20.000.000
If I declare to 2.000.000 program speed is about 3x speed then declare 20.000.000.
Can I set some dynamic declaration without set to fix number of array elements ?
Yes, You can
Code: Select all
arow := {}, cstring := ""
open file
do while not end of file
cstring := read line
aadd(arow, cstring)
enddo
close file
Best regards
Leon
Leon
Re: Array size and speed application
... aadd().. ok,
I tested it now, super !!! , time processing from 11 sec to 5sec.
I reprogramming old C++ utilities and always comparing time processing old C++ and alaska.
In this example time C++ utility is about 3sec, it is nearly alaska xbase result.
Thank you
I tested it now, super !!! , time processing from 11 sec to 5sec.
I reprogramming old C++ utilities and always comparing time processing old C++ and alaska.
In this example time C++ utility is about 3sec, it is nearly alaska xbase result.
Thank you
Re: Array size and speed application
Hi,
Maybe you can post your code. Perhaps it can be optimized to get even better results.
Maybe you can post your code. Perhaps it can be optimized to get even better results.