On 14.11.2009, at 23:07, John Worden wrote:

> So are you saying that my example is slow because of the time taken to 
> process the text data files in Squeak? (I was using 3.10)
> 
> Not that it matters in this case but how would I work around this if it were 
> a real application that needed to handle data in this way?
> 
> John

If you do, e.g., 

        FileStream readOnlyFileNamed: myFileName

it creates a MultiByteFileStream nowadays (see #concreteStream). It would be 
nice if we could just set a no-op converter in a MultiByteFileStream. However, 
that class has not been optimized for speed yet, even without an expensive 
converter it is much slower. It reads characters one-by-one instead of 
block-wise, which obviously isn't speedy exactly, as you noticed.

Instead of the abstract FileStream use the stream class you want explicitly. 
StandardFileStream is the old class that does no conversion. So you would open 
your file like this instead:

        StandardFileStream readOnlyFileNamed: myFileName

- Bert -

_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to