File Performance Q.?
John M McIntosh
johnmci at smalltalkconsulting.com
Sun May 12 03:29:08 UTC 2002
>John M McIntosh wrote:
>[snip]
>>I'm curious if you are reading and writing the entire chunk in one
>>operation with a standard file stream. Taking 32 seconds to do the
>>read/write is excessive. I wonder if a full GC event with paging is
>>going on to affect your numbers. I would have expected something <
>>2-3 seconds so seeing 32 seconds has a very wrong feel to it.
>>
>>Maybe some other windows user can try it?
>
>As far as I know it is read in one operation.
> >>> file1 := ReadStream on: file1 contentsOfEntireFile.
>file1 is created as StandardFileStream
>
>Isn't the write all in a single operation using 'flush'?
>
>There is a tremendous discrepency between Squeak on Windows and Linux.
>Windows PII 266 being 33 seconds (with Python at 3 seconds) and
>Linux Athlon 700mhz being .23 seconds (with Python at 1 second).
>I'll try my Mac later.
>
>Jimmie Houchin
Doing file2 nextPutAll: file1 contents. where file1 and file2 are
standardfilestreams is a bit different.
file1 contents gives you a chunk of bytes that is the contents of the
file, with little overhead. nextPutAll: then writes that entire chunk
to disk, again with little fuss.
doing file1 contentsOfEntireFile again gives you the chunk of bytes
that is the file, but then doing a ReadStream on: and reading bytes
at a time then writting them is inefficient. Unless of course you
really need to do this.
Still if you are saying the code on windows takes 33 seconds, but
then under linux takes 0.23 seconds then why is Bill rich? (Hah...)
Lets argue the 700 mhz machine is 10x faster so 2.3 seconds versus
33? Is windows ME that bad?
At 4:31 PM -0500 5/11/02, Jimmie Houchin wrote:
>Isn't the write all in a single operation using 'flush'?
Some systems lie about the flush. But data should be sent to disk on
the nextPutAll: call because that becomes a file system write command
of some sort. The file should be automatically flushed (depends on
os?) at close. However the explicit flush command (should but review
the VM logic to be sure) will ensure the data actually gets to disk
successfully at the point it returns, but that might be redundant due
to the following close.
--
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
===========================================================================
More information about the Squeak-dev
mailing list
|