Modify

#2002 closed Bug (Rejected)

Try to find the cause of slow file operations.

Reported by: Valik Owned by:
Milestone: Component: AutoIt
Version: 3.3.7.14 Severity: None
Keywords: Cc:

Description

File operations inexplicably took a turn for slow performance. This is a reminder to myself to investigate the issue. The discussion thread can be found here.

Attachments (0)

Change History (9)

comment:1 by Valik, on Sep 20, 2011 at 9:53:39 PM

Note to self: Start checking revisions beginning with 5490.

comment:2 by Shaggi, on Feb 21, 2012 at 7:16:10 PM

The cause is simple, your old autoit relied on buffered i/o operations while your new doesn't. This means small filewrites done a lot of times (on usual c, buffer is 4k bytes) is a lot quicker than unbuffered. However, for sizes > 4k bytes, pure winapi is bound to be quicker.

You can read about it here: http://www.codeguru.com/forum/archive/index.php/t-228554.html

comment:3 by trancexx, on Feb 21, 2012 at 8:12:34 PM

How would you know what AutoIt relies on?

Maybe AutoIt currently uses 64kB buffer. Prior mentioned revision it was CRT's choice for default read/write modes. Then it could have been set to 32kB and eventually to current value.
That can be the cause, but it's not something that's simple.

in reply to:  3 ; comment:4 by Shaggi, on Feb 21, 2012 at 8:42:10 PM

Replying to trancexx:

How would you know what AutoIt relies on?

Maybe AutoIt currently uses 64kB buffer. Prior mentioned revision it was CRT's choice for default read/write modes. Then it could have been set to 32kB and eventually to current value.
That can be the cause, but it's not something that's simple.

Obviously i dont, but valik mentioned that you switced from crt to winapi. Size of the buffer is ofcourse relevant, but i do believe the cause is the switch from usermode buffering to raw os calls. Every test in these threads show, that it is most likely

in reply to:  4 ; comment:5 by trancexx, on Feb 21, 2012 at 10:15:08 PM

Replying to Shaggi:

Obviously i dont, but valik mentioned that you switced from crt to winapi. Size of the buffer is ofcourse relevant, but i do believe the cause is the switch from usermode buffering to raw os calls. Every test in these threads show, that it is most likely

"Usermode buffering"?
Where else could AutoIt be buffering? Shaggi you don't make sense now or I'm missing your point completely.

in reply to:  5 comment:6 by anonymous, on Feb 21, 2012 at 10:59:12 PM

Replying to trancexx:

Replying to Shaggi:

Obviously i dont, but valik mentioned that you switced from crt to winapi. Size of the buffer is ofcourse relevant, but i do believe the cause is the switch from usermode buffering to raw os calls. Every test in these threads show, that it is most likely

"Usermode buffering"?
Where else could AutoIt be buffering? Shaggi you don't make sense now or I'm missing your point completely.

Usermode = opposite of kernelmode. The crt resides in usermode, which is where the buffering happens.. That should make sense? The point was (based on your comments) that you switched from buffered io to unbuffered io, which evidently carries a loss in speed for small operations.

comment:7 by trancexx, on Feb 21, 2012 at 11:05:32 PM

No it doesn't.
Who mentioned unbuffered stuff?

Anyway, thanks for the hint.

comment:8 by Valik, on Feb 23, 2012 at 3:43:42 AM

Yes, because we totally turned off buffered I/O and I'm a complete moron and missed it. Except for the fact that there's no code explicitly changing anything to do with buffering. Indeed, I also eliminated the switch from CRT to WinAPI as being the cause so any internal buffering differences are already irrelevant.

comment:9 by Jon, on Jul 21, 2013 at 11:31:57 PM

Resolution: Rejected
Status: newclosed

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.