[squeak-dev] 20X speedup for read file upToEnd

David T. Lewis lewis at mail.msen.com
Sat Jan 23 00:51:13 UTC 2021


On Fri, Jan 22, 2021 at 03:53:00PM -0800, tim Rowledge wrote:
> 
> > On 2021-01-22, at 3:24 PM, David T. Lewis <lewis at mail.msen.com> wrote:
> > 
> > <Speedup-file-upToEnd-dtl.1.cs>
> 
> Looks pretty sensible to me. As a small aside, I noticed when reading
> '.po' files (that Scratch uses for language translation dictionaries) that
> explicitly using StandardFileStream in place of MultiByteFileStream in
> appropriate places could speed up file reading immensely; I suspect your
> change will solve that worry.
>

I suspect that these are two separate issues, but I'm also pretty sure
there are plenty of other small places where I/O can be improved.

For the case of #upToEnd I found that MultiByteFileStream was already
five times faster than StandardFileStream due to improvements that Levente
did back in 2009. So I took Levente's logic, added the "don't read it one
byte at a time" change, and moved it up to StandardFileStream.

It would be worth profiling the '.po' file reading in Scratch and seeing
where the time is going. Maybe there is another I/O method that could
be easily improved.

Dave



More information about the Squeak-dev mailing list