前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Spring 2.5 Perfomance Improvements 200% 直逼 Guice

Spring 2.5 Perfomance Improvements 200% 直逼 Guice

作者头像
阿敏总司令
发布2019-02-28 11:15:21
3670
发布2019-02-28 11:15:21
举报
文章被收录于专栏:简单就是美!

阅读更多

并发性能提升的原因之一是使用了 ConcurrentHashMap,原来的 Collections.synchronized(new HashMap()) 存在同步锁的性能瓶颈;

如果你是用JDK 5.0或以上的版本,就可以直接得到这个性能的提升的好处了。

或者下载 Emory concurrent utilities backport 加到 CLASSPATH 中

http://dcl.mathcs.emory.edu/util/backport-util-concurrent/

当然还要努力,越快越好啦。。。

引用

The upcoming Spring Framework version 2.5 will bring a 200% improvement for concurrent access over Spring 2.0.*. I used Crazy Bob's Semi Useless Benchmark ™ as a starting point. I fiddled with the code slightly to change the default behavior from "prototype" to "singleton", and I saw that spring 2.5 was faster than Guice for singletons. Here are some benchmarks (there is variability based on the runs)     * Spring 2.0 vs. guice 1.0:           o Prototype: Single thread: Spring is 50-150X slower. Concurrent: Spring is 50-150X slower.           o Singleton: Single thread: Spring 3X slower - 2X faster. Concurrent: Spring is 5-10X slower     * Spring 2.0.6 vs. guice 1.0:           o Prototype: Single thread: Spring is ~10X slower. Concurrent: Spring is 5X slower.           o Singleton: Single thread: Spring 2X slower - 2X faster. Concurrent: Spring:Guice ~2:3     * Spring 2.14m vs. guice 1.0:           o Prototype: Single thread: Spring is 5-7X slower. Concurrent: Spring is 3-4X slower.           o Singleton: Single thread: neck and neck. Concurrent: Spring is 1-1.5X faster     * guice 1.0:           o Prototype: Single thread vs. Concurrent: Concurrent might be a bit slower than single threaded           o Singleton: Single thread vs. Concurrent: Concurrent is quite a bit faster than single threaded

详细请见这里

http://www.jroller.com/Solomon/entry/spring_2_5_perfomance_improvements

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2007-10-10 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档