[squeak-dev] news from the Xtream front

Gary Chambers gazzaguru2 at btinternet.com
Tue Dec 8 15:18:24 UTC 2009


For some of our stuff we've had to switch to StandardFileStream (given ascii 
encoding) to get a 10x perfromance improvement. Would be nice to not have to 
do so!

Regards, Gary

----- Original Message ----- 
From: "Levente Uzonyi" <leves at elte.hu>
To: "The general-purpose Squeak developers list" 
<squeak-dev at lists.squeakfoundation.org>
Sent: Tuesday, December 08, 2009 2:12 PM
Subject: Re: [squeak-dev] news from the Xtream front


On Tue, 8 Dec 2009, Nicolas Cellier wrote:

>
> Oh yes, like this ?
>
> | file |
> [file := MultiByteFileStream newFileNamed: 'mbfs_skip.tst'.
> file ascii; wantsLineEndConversion: false; converter: UTF8TextConverter 
> new.
> file nextPutAll: 'Ceci doit changé'.
> file skip: -1. "Oops - grammatically incorrect"
> file nextPutAll: 'er'.
> file close.
>
> file := StandardFileStream oldFileNamed: 'mbfs_skip.tst'.
> file ascii.
> file contentsOfEntireFile.]
> ensure: [file close.
> FileDirectory default deleteFileNamed: 'mbfs_skip.tst'].
> -> 'Ceci doit chang?er' "Oops squeakly incorrect"
>
> Ah Ah, MultiByteFileStream let us see a stream of encoded characters,
> but position over a stream of bytes...
> The only programmer choice is to put marks (by inquiring aMBFS
> position) and restore position using these marks...
>

Well, this part is broken, but the current fileIn/fileOut code relies on
this bug/"feature", otherwise it would be easy to fix it in the utf8 case.
Actually I was thinking about CompiledMethod >> #getPreambleFrom:at: or
even worse PositionableStream >> #backChunk.

> Making something simple out of current MultiByteFileStream mess is a
> challenge I don't even want to take, but you seem a but tougher than
> me.
>

I think the current performance of MultiByteFileStream is acceptable for
general use. According to my measurements the greatest bottleneck is
WriteStream >> #nextPut: for typical operations.


Levente

> Cheers
>
> Nicolas
>
>>
>> Levente
>>
>>> Cheers
>>>
>>> Nicolas
>>>
>>>
>>
>>
>
>


--------------------------------------------------------------------------------


>
> 




More information about the Squeak-dev mailing list