[Y-devel] Proposal: message structure change

Mark Thomas mark at www.y-windows.org
Thu Feb 26 20:53:01 GMT 2004


Ulrik Mikaelsson wrote:
> I absolutely agree with you on this. Forcing string conversion/parsing of all
> types of data, such as integers, is quite suboptimal.

Since the client could be on a machine with a different number 
representation, *some* conversion is going to have to happen.

int -> string -> int isn't as slow as you might expect, and it certainly 
simplifies the protocol.

> However, there are three other things which I would like to be considered in
> the protocol:
> 
> * Whether all the header fields REALLY should be 4 bytes long. Should a
> message ever be allowed to be larger than 64k, on a synchronized protocol,
> for instance?
>         Pros:
>  - Smaller header. Lesser overhead may be significant for small operations,
> (such as reading and int).
>         Cons:
> - Stricter limitations.

I don't think saving two bytes per message is going to gain us that much 
:-)  Plus you'll kick yourself the day you want to send a 65k message.

> * Maybe we should add some client-set request-id in the header for
> method-calling, property-reading and every request that will have a response,
> and thereby allow asynchronous I/O in the protocol?

Asuffield has been working on this.  He's using the "reserved for future 
use" ext field.

> * How is character encoding dealt with right now? I'm not really sure whether
> the protocol in it's current form would allow things like UTF-8 or UTF-16?
> And what about KOI or Japanese language support?

All UTF-8.  I'm not going near the quagmire of other language encodings.

I'm aware of the Unicode issues with Han unification.  For now, we'll 
have to make do with what we've got.  That's for the Unicode people to 
sort out.

I seriously doubt the message protocol is ever going to be a bottleneck.
If necessary, though, we can make a new protocol some time in the future 
as a new module.

Regards,

   Mark.
-- 
|| Mark Thomas
|| www.y-windows.org
||
||



More information about the Y-devel mailing list









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