I did some modifications to Bryce's source code and the results are a bit differents :
Code:
break on

dim $start, $arrInc, $inc, $file

$arrInc = 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192

for each $inc in $arrInc
dim $file

$start=@TICKS
$file = ""
$file = loadfile("dir.txt")
$file = ""
? "Loadfile() = " @TICKS - $start

chr(9)

$start=@TICKS
$file = ""
$file = readfile("dir.txt", $inc, 0)
$file = ""

"constant increment ReadFile("+$inc+") = " @TICKS - $start

chr(9)

$start=@TICKS
$file = ""
$file = readfile("dir.txt", $inc, 1)
$file = ""

"variable increment ReadFile("+$inc+") = " @TICKS - $start
next
?
exit

; will load the contents of a text file into an array only with Kix
Function ReadFile($file, optional $inc, optional $incvariable )
Dim $, $i,$f,$L, $j

if not $inc $inc = 1 endif

Dim $ReadFile[$inc]

$f = FreeFileHandle()
$ = Open($f,$file)
if @Error
Exit @Error
endIf

$i = -1
$j = 0
$L = ReadLine($f)
While not @Error
$i = $i + 1
if $i > $j
$j = $j + $inc
ReDim Preserve $ReadFile[$j]
if $incvariable
$inc = $inc + $inc
endif
endif
$ReadFile[$i] = $L
$L = ReadLine($f)
Loop
$ = Close($f)
if $i=-1
$ReadFile = ""
exit 1
else
redim preserve $ReadFile[$i]
exit 0
endif
EndFunction

; will load the contents of a text file into an array with WScript
Function loadfile($file)
DIM $, $fso,$f,$fs
$fso = CreateObject("Scripting.FileSystemObject")
$f = $fso.GetFile($file)
If @ERROR Exit(2) EndIf
$fs = $f.OpenAsTextStream(1)
$loadfile = Split($fs.Read($f.size),@CRLF)
$ = $f.Close
Exit(@ERROR)
EndFunction



the results (in ms) are :
Code:
Loadfile() = 961       constant increment ReadFile(1) = 1482        variable increment ReadFile(1) = 651
Loadfile() = 1042 constant increment ReadFile(2) = 1372 variable increment ReadFile(2) = 671
Loadfile() = 1091 constant increment ReadFile(4) = 1282 variable increment ReadFile(4) = 671
Loadfile() = 1142 constant increment ReadFile(8) = 1201 variable increment ReadFile(8) = 691
Loadfile() = 1232 constant increment ReadFile(16) = 1122 variable increment ReadFile(16) = 741
Loadfile() = 1272 constant increment ReadFile(32) = 1191 variable increment ReadFile(32) = 731
Loadfile() = 1262 constant increment ReadFile(64) = 1042 variable increment ReadFile(64) = 741
Loadfile() = 1262 constant increment ReadFile(128) = 961 variable increment ReadFile(128) = 761
Loadfile() = 1272 constant increment ReadFile(256) = 821 variable increment ReadFile(256) = 731
Loadfile() = 1352 constant increment ReadFile(512) = 791 variable increment ReadFile(512) = 741
Loadfile() = 1292 constant increment ReadFile(1024) = 771 variable increment ReadFile(1024) = 731
Loadfile() = 1282 constant increment ReadFile(2048) = 751 variable increment ReadFile(2048) = 741
Loadfile() = 1242 constant increment ReadFile(4096) = 801 variable increment ReadFile(4096) = 761
Loadfile() = 1342 constant increment ReadFile(8192) = 842 variable increment ReadFile(8192) = 761



it's surprising because time for LoadFile should be constant and it is not.

"constant increment" means that when i redim an array, i add a constant value to the current size.
"variable increment" means that when i redim an array, i add a value to the current size and then, i multiply this value by 2 for the next resizing.

I am working on a Pentium IV 2 Mhz with 512 MB.
The OS is Windows NT 4 SP6a

PS : sorry for my english
_________________________
Christophe