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>







