[squeak-dev] Re: StandardFileStream>>#readInto:startingAt:count:
appears badly broken
Levente Uzonyi
leves at elte.hu
Mon Mar 15 20:48:37 UTC 2010
On Mon, 15 Mar 2010, Chris Muller wrote:
>> On the other hand, current stupid implementation prevents performing a
>> useless copy, except near end of stream...
>
> Yes, that's a big problem! Not only do I no longer have access to the
> primitive, it costs me an allocation every time I want just to read
> from a file into MY ByteArray. Aren't there any other solutions? Can
> we talk about this?
>
>
Thanks for the bug report Chris and for fix Nicolas. I think we now have
the best we can. I doubt that losing direct access to the primitive
will be a bottleneck. On my pc, I could achieve 360MB/second read speed
with the preivous implementation of #next:into:startingAt: if the data was
already cached in memory. If you really have to access the primitive, you
can still do that by turning off the read buffer (#disableReadBuffering)
and use the primitive accessor #primRead:into:startingAt:count: directly.
Levente
More information about the Squeak-dev
mailing list
|