开发者

want to find a encode format to improve performance of websocket for web game

I use json as the serialize format that runs on websocket in my web game at first. But there are so much redundancy in json. So I want to find a more effective format to serialize my object.

And then I found protojs(https://github.com/sirikata/protojs) which implements protobuf in javasc开发者_JS百科ript. But its encoding performance is so poor (about 20+ times of json) since javascript dose not support type cast and it has to do a lot math operations to convert the primary data type (such as double) to bytes to do the protobuf encoding. The result turns out to be that request in protojs is much slower than in json.

Is there any good idea to improve the efficiency of data communication on websocket in web game?


I recently attended onGameStart (write-up here) and Rob Hawkes of Mozilla and Rawkets fame mentioned BSON (Binary JSON). However, he did say that he wasn't 100% sure if it improved efficiency.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜