转自:http://docs2x.smartfoxserver.com/Overview/sfs2x-protocol java
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越大,结果越大。平时咱们看算法的做用彷佛可有可无,因而可知,算法是很重要的。