Jump to content
Sign in to follow this  
mike2003

FileReadLine very slow on 3.2

Recommended Posts

mike2003

I had 3, 1, 1, 0 version of AutoIT very long

And now i updated to 3, 2, 12, 1

$oldfile = FileOpenDialog("File", ".", "Text files (*.txt)", 1)
if @Error = 1 then exit
$i=0
while 1
    $i=$i+1
    ToolTip("aaa "&$i)
    $oldline = FileReadLine($oldfile,1789)
wend

in some my scripts i use this FileReadLine function

in 3.1 its work very quick ( i see refresh of ToolTip("aaa "&$i))

i cant read tooltips number $i

but! on new 3.2 its very very slow!!!!

tooltips +1 on $i in ONE second!!!!

all my scripts begin work very slow!!

and with rise line-number for function speed slow and slow and slow

win98 / pentium3 - 500

ansi version of 3.2

Please fix this or say me what i can do!!!

ps

sorry for english :P

Share this post


Link to post
Share on other sites
ChrisL

Try this

#Include <File.au3>

$oldfile = FileOpenDialog("File", ".", "Text files (*.txt)", 1)
if @Error = 1 then exit
Local $aFile 
If Not _FileReadToArray($oldfile,$aFile) then 
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf   
    
For $i = 1 to $aFile[0]
    $line = $aFile[$i]
    ConsoleWrite($Line & @crlf)
    ToolTip("Line number " & $i)
Next

Share this post


Link to post
Share on other sites
mike2003

on WinXP (this computer) and that script

AutoIt3A.exe very slow too

but AutoIt3.exe normal speed

may be bug in ansi version?

Share this post


Link to post
Share on other sites
mike2003

script in first post - for example only - demonstartion of speed

but i am already have some other old my scripts

and its have low speed only in ansi version for 98

very low

Share this post


Link to post
Share on other sites
mike2003

Try this

#Include <File.au3>

$oldfile = FileOpenDialog("File", ".", "Text files (*.txt)", 1)
if @Error = 1 then exit
Local $aFile 
If Not _FileReadToArray($oldfile,$aFile) then 
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf   
    
For $i = 1 to $aFile[0]
    $line = $aFile[$i]
    ConsoleWrite($Line & @crlf)
    ToolTip("Line number " & $i)
Next
thanks for that!

i replace some my code with _FileReadToArray - its work very very faster then my old FileReadLine ( 5 sek VS 2 minutes)! its great!

But the low speed in FileReadLine of Ansi version and normal speed in XP (with same hardwares) need a fix!

Share this post


Link to post
Share on other sites
ChrisL

thanks for that!

i replace some my code with _FileReadToArray - its work very very faster then my old FileReadLine ( 5 sek VS 2 minutes)! its great!

But the low speed in FileReadLine of Ansi version and normal speed in XP (with same hardwares) need a fix!

Using FilereadLine as far as I know sucks anyway, because each time you use it it reads from the start up to the line you need.

Using the array should be much faster on any computer OS

Share this post


Link to post
Share on other sites
mike2003

using FilereadLine as far as I know sucks anyway, because each time you use it it reads from the start up to the line you need.

may be, but why one script work with diferent speed on

AutoIt3.exe

AutoIt3A.exe

on same OS (win XP sp2)?

Share this post


Link to post
Share on other sites
Confuzzled

Maybe your input text needs conversion overheads? Does it use some of the extended ANSI character set?

Share this post


Link to post
Share on other sites
mike2003

the simple script in first my post demonstrate this bug!

no conversion... only lineread

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.