最近在为公司的分布式服务框架做支持异步调用的开发,这种新特性的上线需要进行各种严格的测试.在并发性能测试时,性能一直非常差,而且非常的不稳定.经过不断的分析调优,发现Socket通信和多线程异步回调存在较为严重的性能问题.经过多方优化,性能终于达标.下面是原版本.支持异步最初版本和优化后版本的性能比较.差异还是非常巨大的.另外说明一下,总耗时是指10000次请求累计执行时间. 从上图可以看到,支持异步的版本,在单线程模式下,性能的表现与老版本差异并不明显,但是10线程下差异就非常巨大,而100线…