轉自: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越大,結果越大。平時咱們看算法的做用彷佛可有可無,因而可知,算法是很重要的。