Squeak file stream performance

Michel Tilman mtilman at acm.org
Sat Aug 14 18:17:50 UTC 1999


Thanks,

I had intended to enforce a flush after every character write in VW (just to
explore the limits) in #nextPut: but I just noticed I made a mistake,
resulting in too few extra buffer flushes ... Now I get a 3.2 times
performance difference (although VW does more of the actual computing in
Smalltalk). At least things start to make sense again ...

Michel

----- Original Message -----
From: Stephen Pair <spair at advantive.com>
To: <squeak at cs.uiuc.edu>
Sent: Saturday, August 14, 1999 5:48 PM
Subject: RE: Squeak file stream performance


> This is probably because VW is using buffered file streams, whereas Squeak
> is not.  A better comparison would be to write the VW version as:
>
>     | stream |
>
>      stream := 'Bad.txt' asFilename writeStream.
>      17476266 timesRepeat:
>           [ stream nextPutAll: 'BAD'; flush ].
>      stream close
>
> Even still, VW appears to be about twice as fast on my system.
>
> - Stephen
>
> > -----Original Message-----
> > From: Michel Tilman [mailto:mtilman at acm.org]
> > Sent: Saturday, August 14, 1999 10:18 AM
> > To: squeak at cs.uiuc.edu
> > Subject: Squeak file stream performance
> >
> >
> > Hello,
> >
> > I compared the following (obviously non-optimized) code in Squeak 2.4
> >
> >     | stream |
> >
> >     stream := FileStream newFileNamed: 'Bad.txt'.
> >     17476266 timesRepeat:
> >          [ stream nextPutAll: 'BAD' ].
> >     stream close
> >
> > to its Vw5i counterpart:
> >
> >     | stream |
> >
> >     stream := 'Bad.txt' asFilename writeStream.
> >     17476266 timesRepeat:
> >          [ stream nextPutAll: 'BAD' ].
> >     stream close
> >
> > Time for the Squeak version is 12 min 18 seconds, for VW5i 23 seconds, a
> > rather large (32 times) performance difference, although the Squeak
> > #nextPutAll: method builds directly on a primitive. Flushing
> > every character
> > write in VW hardly slowed it down. The PC is a Pentium III 450 with 256
MB
> > RAM. Does anyone have any ideas about this difference?
> >
> > Does anyone have any experience with database acces in Squeak,
> > e.g. how well
> > the memory manager is suited for dealing with larger pieces of data?
> >
> > Thanks,
> >
> > Michel
> >
> >
>
>





More information about the Squeak-dev mailing list