The SmartFoxServer 2X client-server protocol

转自:http://docs2x.smartfoxserver.com/Overview/sfs2x-protocol


1 网络通信内容用二进制流来替代xml

SmartFoxServer 2X uses a highly effiecient binary protocol that makes the server performance outstanding under different aspects. Messages are light on the bandwidth and fast to parse by the client and server engine. Additional on-the-fly compression allows for extra size reduction without impacting the general performance.
网络开销和cpu开销相比,常用的做法就是用cpu来换网络带宽。


2 改进协议处理算法

Protocol performance

The overall performance of the protocol parsing is also significantly improved in version 2X on both the server and client. Especially on the server side this has a notable effect. We have benchmarked the amount of messages per second that can be parsed with the old text protocol versus the new one.
算法A-算法B=0.01s,那么N×差值,N越大,结果越大。平时我们看算法的作用似乎无关紧要,由此可见,算法是很重要的。






你可能感兴趣的:(protocol,smartfoxserver)