[Y-devel] Proposal for a minor change in the Y-protocol

Andreas Karafyllis ankar at homodigitalis.net
Sun Apr 11 22:52:08 BST 2004


On Sunday 11 April 2004 21:24, Richard Hills wrote:
> Hey,
>
> > > In the comments in the libYc is written thet the '\0' may be not used
> > > in the future. I go for it. The '\0' is not needed. You should depend
> > > to "member length" field find how big the string is. And null
> > > terminated strings are a bad idea anyway. A very nice article about
> > > this topic is the following:
> > > https://www.joelonsoftware.com/articles/fog0000000319.html
>
>     As far as I understand the \0 isn't needed, but when I was writing that
> part of libYc it was easier at the time to just include it. Neither the
> server nor libYc clients rely on it.

Ok, nice to hear this...

>
> > 4-bytes aligend addresses. There are to reason I do not like it:
> > 1) It is ugly :-)
> > 2) Most modern  RISC processors do not work very happily with
>
> not-aligned
>
> > values. We should try to make serialization - deserialization as fast
>
> as
>
> > possible
>
>     I don't really think it's that ugly. And although we want
> deserialization to go fast, I don't think this will have a significant
> effect on speed. If you can point out a protocol which does align
> everything to the nearest 4 bytes for this reason I'd be interested to
> see it.
>
No, I do not have a specific protocol in mind. I would investigate it if  I 
find time. Perhaps in recent protocols is taken into account.
I only know that processors like ARM need more cycles to read/write not 
aligned 32-bit values. I assume the same happens with PowerPC. In x86 should 
not make any difference I think.
I agree that the speed improvement will be small. The amount of time to 
serialize/deserialize must be relatively small compared to the time a socket 
transaction needs. The reasons I made the proposal are more "aesthetic" than 
functional. It is of course subjective, if something is ugly or not, and I 
will not argue further :-)

Andreas




More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved