---
title: "SpringMVC和Struts2以及Struts2-convention-plugin性能评测"
author: "aokunsang"
date: "2013-03-26T17:18:41Z"
tags: []
categories: ["开源软件"]
slug: "springmvc-struts2-struts2-convention-plugin"
draft: false
lastmod: "2013-03-27T09:45:30Z"
id: 1836839
url: "https://aokunsang.iteye.com/blog/1836839"
---

网上看到很多SpringMVC3.0和struts2的测试比较，我也用apache自带的ab测试了下。

 

    测试环境：

 

            测试服务器：Dell笔记本   酷睿双核  4G cpu  win7   tomcat6.0

                   测试机：centos 虚拟机

                   并发数：50

                请求次数：1000

                测试目的：(1)、测试springMVC和struts2性能差距；

                                 (2)、测试springMVC和struts2 convention-plugin的性能差距；

                                 (3)、测试jstl和struts2标签性能差距。

                使用框架：SpringMVC3.1.2、Struts2.3.4

          前提：没有连接数据库，没有复杂的业务逻辑处理，仅仅List保存几条数据。在页面上用两种标签进行迭代显示、

        

服务器Action代码相同，如下：

```
public String execute(){
		
		args = new ArrayList<String>();
		args.add("北京");
		args.add("上海");
		args.add("广州");
		args.add("深圳");
		prop = "属性值-1111";
		
		return SUCCESS;
	}
```

    
![](http://dl.iteye.com/upload/attachment/0082/2297/bbab8898-683b-3cc4-8051-675f96656a62.jpg)  
 

     总结：

          1、SpringMVC从各项指标看，SpringMVC3.1完胜其他框架；\[偶尔每秒请求数能上1000+]

          2、纯粹的Struts2性能还不错(没有加入spring)；

          3、struts2+convention-plugin，我去，这效率太狗血了。

          4、jstl比struts2的标签速度略胜一筹。(我只测试了简单的迭代，还有待测试，有人说struts2的标签性能很差)  参考：[http://elf8848.iteye.com/blog/698217](http://elf8848.iteye.com/blog/698217)

  

      PS：并发数和请求次数都不是太大，虽然会有偏差和错误，但是侧面可以反映出一些问题的。