摘要: spring配置的bean是默认单例,那么在程序中,得到一个实例一定比创建一个实例的速度快,也更加省资源。今天实际测试的时候发现,new 一个对象比spring得到一个对象快多了。后面自己又加了个单例测试,来对比一下,看实测结果:public static void main(String[] args) { ReceiveProcess receiveProcess; ApplicationContext appCt = new ClassPathXmlApplicationContext("classpath:applicationContext.xml"); ... 阅读全文
posted @ 2014-03-18 15:13 wxwall 阅读(2816) 评论(23) 推荐(0) 编辑