http - lets-mica/mica-jmh GitHub Wiki
http 压测结果报告
第一轮
Benchmark Mode Cnt Score Error Units
MicaHttpBenchmark.micaHttp thrpt 5 899.299 ± 208.080 ops/min
MicaHttpBenchmark.okHttp thrpt 5 841.669 ± 106.094 ops/min
MicaHttpBenchmark.protoTypeOkHttp thrpt 5 346.647 ± 23.664 ops/min
第二轮
Benchmark Mode Cnt Score Error Units
MicaHttpBenchmark.micaHttp thrpt 5 876.651 ± 276.569 ops/min
MicaHttpBenchmark.okHttp thrpt 5 899.365 ± 194.188 ops/min
MicaHttpBenchmark.protoTypeOkHttp thrpt 5 341.028 ± 34.713 ops/min
第三轮
Benchmark Mode Cnt Score Error Units
MicaHttpBenchmark.micaHttp thrpt 5 944.017 ± 175.509 ops/min
MicaHttpBenchmark.okHttp thrpt 5 875.143 ± 164.594 ops/min
MicaHttpBenchmark.protoTypeOkHttp thrpt 5 331.370 ± 19.136 ops/min
解读
- mica-http 对 okhttp 进行增强,并没有明显的性能损耗,偶尔结果还比 okhttp 表现得好。
- protoTypeOkHttp 采用的是每次 new OkHttpClient() 性能损耗明显非常明显,而且高并发下还有内存泄露,所以大家在使用时一定要注意。