天天看點

struts2的性能為什麼這麼差,有性能測試截圖

最近覺得struts2性能感覺好差,然後就對struts2和springMVC3分别作了以下性能測試,結果太讓人吃驚了!

機器配置是 T6600 + 2G記憶體

執行一條最簡單的查詢語句,500線程

select * from folder where fid = '1' order by orderNum

struts2 + spring3 + hibernate 的測試結果

[img]http://dl.iteye.com/upload/attachment/257409/35cc5aaf-e6c3-3c0e-bb87-edf4b45bbc37.png[/img]

struts2 + spring3 + mock對象的測試結果

[img]http://dl.iteye.com/upload/attachment/257454/8bf62537-bf6a-3937-80eb-d6493de8dd83.png[/img]

spring3 MVC + hibernate 的測試結果

[img]http://dl.iteye.com/upload/attachment/257413/4273bf8c-b8ea-31bd-8f49-79e6c9dbcbb8.png[/img]

最後是spring3 MVC + jdbc 的測試結果

[img]http://dl.iteye.com/upload/attachment/257411/7733a748-9ec6-3ff9-a9e9-4122a5eda7db.png[/img]

根據最後兩種情況可以看到 hibernate 對性能的損失尚可接受,但是struts2的性能為什麼和 spring3 MVC 差這麼多 -_-b

最後附上struts2官方的helloWorld例子程式的測試結果

[img]http://dl.iteye.com/upload/attachment/258086/83dd1f7f-e869-34d5-ada8-11dbe2749046.png[/img]

性能也不容樂觀。。。。。。

這個是官方的helloworld例子使用的jar包如下

然後是我的 struts.xml 配置檔案,log 也已經設定到 ERROR 級别