[Pharo-users] Slow object printOn: with EURO symbol
hilaire at drgeo.eu
Tue Jan 5 07:08:53 EST 2016
Le 04/01/2016 11:05, Henrik Johansen a écrit :
> In the fallback code for WriteStream >> #nextPut:, at:put: is called, so yes, streaming a wide char causes the streams collection to be converted from Byte to WideString.
> Conversion is done using become, which currently triggers a full heap scan for references, and is thus very slow.
> One could add a fast-path along the lines of #pastEndPut: (which has already broken any assumption that a reference to the collection will reflect all writes for the lifetime of stream, for the same performance problems one would face using #become:); if collection is a ByteString and anObject is a wide characters, replace collection with a WideString, and *then* call at:put:
> But, it is not a very nice thing to add to a generic streaming class, nor is it a very attractive at this point in time considering that making become: a fast operation is one of the problems solved by Spur.
So wait and see for Spur?
To not forget about it, it is recorded here, and it should be kept open
for later check:
It is possible to turn around this problem, but this sort of annoyance
with Pharo internal encoding regularly arises, so I am not sure what to
think about the state of Pharo regarding internal encoding. Now days is
not supposed to be all utf-8?
More information about the Pharo-users