On 13 Sep 2011, at 13:10, Göran Krampe wrote: > I could and will try to squeeze it in, but I am mainly hacking Jtalk these > days :)
OK >> The cool thing is: all of Zn's +170 unit tests, most doing actual HTTP >> client and server interactions (some over the internet) succeed using the >> new Zodiac socket stream implementation. > > Have you also measured performance? Compared to old SocketStream? Just > curious. No, not yet, but it feels OK ;-) I think it is quite a challenge to measure socket stream performance objectively. > The earliest SocketStream by Bolot also used an internal object for each > "direction" of the stream - a BufferStream I think it was called. And nuking > those to make SocketStream operate directly on buffers with the ability to > move "pointers" etc was one of the main optimizations in order to minimize > copying etc. Yes, one of my goals is to prevent copying and moving bytes around as much as possible. The most optimized version, the one at the bottom of the hierarchy, ZnSocketStream, never copies the data (say a large byte array) that you write, and reads directly into the buffers that you provide - provided you use the right methods of course, i.e. those based on #next: count putAll: collection startingAt: offset and #readInto: collection startingAt: offset count: requestedCount But the first goals are correctness and good unit and functional test coverage.
