You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
As for GemStone 3.3 we do not need #changeTo: hack anymore (and it breaks) #22
On GemStone 3.3 and beyond, the hack of changeClassTo: to convert strings to UTF8 fails. Moreover, #_encodeAsUTF8intoString was added into the system so we should use that.
If it improves the situation I'm not per se against it. However it's in my option not an ideal solution. Let me expand a bit the design philosophy behind the Seaside encoding pipeline.
The Seaside encoding pipeline was designed to allow direct rendering into a socket buffer without intermediate allocations for maximum performance. It is implicitly assumed that the socket buffer is a byte based buffer since that's what operating systems accept.
A Seaside response is per default in text mode in which case only characters and collections of characters should be written to the response stream. Writing bytes or collections of bytes is an error in this case as the response should be put into binary mode for this (see below). In this mode a conversing from characters to bytes is supposed to happen using an encoding. For maximum efficiency characters should be encoded directly to the socket buffer without going through an intermediate collection.
A Seaside response can be but into binary mode (by sending #binary) in which case only bytes and collections of bytes should be written to the response stream. Writing characters or collections of characters is an error in this case as no encoding is present. For maximum efficiency writes in this mode should be copied directly to the socket buffer.
I don't know how much of this GemStone/S supports but if it supports encoding into a buffer without creating an intermediate object then from efficiency point of view this should be used. I have to say as well that I'm not familiar with the Utf8 class, is it supposed to be polymorphic with String?
Perhaps a good inspection of the encoding pipeline in GemStone would be good, but this fix does improve on the current situation, so I don't see a reason not to incorporate it.
Activity
marianopeck commentedon Feb 4, 2017
Actually the
nextPutAll:is only part of Grase..theasStringis part of gemstonemarschall commentedon Sep 4, 2017
That's somehow too much copying.
marianopeck commentedon Sep 10, 2017
It's still much faster and better. @dalehenrich @jbrichau do you agree with me too?
marschall commentedon Sep 10, 2017
If it improves the situation I'm not per se against it. However it's in my option not an ideal solution. Let me expand a bit the design philosophy behind the Seaside encoding pipeline.
The Seaside encoding pipeline was designed to allow direct rendering into a socket buffer without intermediate allocations for maximum performance. It is implicitly assumed that the socket buffer is a byte based buffer since that's what operating systems accept.
A Seaside response is per default in text mode in which case only characters and collections of characters should be written to the response stream. Writing bytes or collections of bytes is an error in this case as the response should be put into binary mode for this (see below). In this mode a conversing from characters to bytes is supposed to happen using an encoding. For maximum efficiency characters should be encoded directly to the socket buffer without going through an intermediate collection.
A Seaside response can be but into binary mode (by sending
#binary) in which case only bytes and collections of bytes should be written to the response stream. Writing characters or collections of characters is an error in this case as no encoding is present. For maximum efficiency writes in this mode should be copied directly to the socket buffer.I don't know how much of this GemStone/S supports but if it supports encoding into a buffer without creating an intermediate object then from efficiency point of view this should be used. I have to say as well that I'm not familiar with the
Utf8class, is it supposed to be polymorphic withString?jbrichau commentedon Oct 7, 2017
I added the fix proposed by Mariano in commit d65731b (I wrongly referenced issue 20 there..) since it does fix a bug.
For reference, the original discussion: http://forum.world.st/Again-Corrup-Error-preventing-debugging-real-seaside-exception-td4932708.html
Perhaps a good inspection of the encoding pipeline in GemStone would be good, but this fix does improve on the current situation, so I don't see a reason not to incorporate it.
jbrichau commentedon Nov 19, 2017
I had done this fix on the dev branch with the idea that it was going to be merged soon. I now added a separate PR #61 for this.
Merge pull request #22 from SeasideSt/master