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包如下

<dependencies>

<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.1.8.1</version>
</dependency>

<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>

</dependencies>


然后是我的 struts.xml 配置文件,log 也已经设置到 ERROR 级别

<struts>

<constant name="struts.devMode" value="false" />

<package name="basicstruts2" extends="struts-default">

<!-- If no class attribute is specified the framework will assume success and
render the result index.jsp -->
<!-- If no name value for the result node is specified the success value is the default -->
<action name="index">
<result>/index.jsp</result>
</action>

<!-- If the URL is hello.action the call the execute method of class HelloWorldAction.
If the result returned by the execute method is success render the HelloWorld.jsp -->
<action name="hello" class="org.apache.struts.helloworld.action.HelloWorldAction" method="execute">
<result name="success">/HelloWorld.jsp</result>
</action>

</package>

</struts>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值