sitemesh性能测试结果比较惊艳(已经补上新的对比测试结果)
最近想在一个项目中使用sitemesh作为view层的装饰器,于是今天就做了一下sitemesh的性能测试。
由于只是测试view层的性能,所以系统框架只有了spring mvc3(3.0.3)+freemarker(2.3.16)+sitemesh(2.4.2)
servlet容器:jetty-6.1.21
jdk:1.6.0_17-b04
压力测试工具:loadRunner 8.1
应用服务器配置:8cup Intel(R) Xeon(R) CPU E5410 @ 2.33GHz; 内存:4G
测试代码:
@Controllerpublic class TestController {@RequestMapping(value="/hello", method=RequestMethod.GET)public void sayHello(Model model){model.addAttribute("timestamp",new Long(System.currentTimeMillis()));}}<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /><meta http-equiv="Cache-Control" content="no-store"/><meta http-equiv="Pragma" content="no-cache"/><meta http-equiv="Expires" content="0"/></head><title>freemarker title</title><body><#list 1..100 as r><#list 1..1000 as xx><h5>${timestamp%xx}</h5></#list></#list></body></html>web.xml:<filter> <filter-name>sitemesh</filter-name> <filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter</filter-class></filter><filter-mapping> <filter-name>sitemesh</filter-name> <url-pattern>/*</url-pattern></filter-mapping>decorators.xml<decorators defaultdir="/decorators"> <!-- Any urls that are excluded will never be decorated by Sitemesh --> <excludes> <pattern>/exclude.jsp</pattern> <pattern>/exclude/*</pattern> </excludes> <decorator name="main" page="main.jsp"> <pattern>/*</pattern> </decorator></decorators>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %><%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page" %><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title><decorator:title default="Mysterious page..." /></title><decorator:head /></head><body><h1>header</h1> <decorator:body /><h1>footer</h1></body></html>







