BBS水木清华站∶精华区
发信人: midi (迷笛), 信区: Java
标 题: Re: CGI, mod_perl, PHP, JSP性能实测比较[转] (转载)
发信站: BBS 水木清华站 (Fri May 5 23:46:14 2000)
换了台机器---原来那台没有PHP,新的没有Enterprise Server:
./ab -n 5000 -c 500 http://localhost/readme.html
Requests per second: 268.00
./ab -n 5000 -c 500 http://localhost/readme.php
Requests per second: 200.22
./ab -n 5000 -c 500 http://localhost/readme.jsp
Requests per second: 22.93
这回的JSP引擎是tomcat。它解释的JAVA程序是
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.util.Vector;
import org.apache.jasper.runtime.*;
import java.beans.*;
import org.apache.jasper.JasperException;
public class _0002freadme_0002ejspreadme_jsp_0 extends HttpJspBase {
static {
}
public _0002freadme_0002ejspreadme_jsp_0( ) {
}
private static boolean _jspx_inited = false;
public final void _jspx_init() throws JasperException {
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
String _value = null;
try {
if (_jspx_inited == false) {
_jspx_init();
_jspx_init();
_jspx_inited = true;
}
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html;charset=8859_1");
pageContext = _jspxFactory.getPageContext(this, request, response,
"", true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
// HTML // begin [file="/readme.jsp";from=(0,0);to=(18,0)]
out.write("<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">\r\n<html>\r\n<head>\r\n
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\r\n <meta name=\"GENERATOR\" content=\"
Mozilla/4.5 [en] (WinNT; U) [Netscape]\">\r\n</head>\r\n<body>\r\n\r\n<center><font size=+2>Netscape Enterprise Server
4.0 Servlets SDK</font></center>\r\n\r\n<hr WIDTH=\"100%\">\r\n<br>The following is a set of samples and example comp
onents, plugins and\r\ntechnologies supported by Netscape Enterprise Server 4.0 Servlet Engine. \r\nThis includes
binaries, all code, a build enviroment and instructions on\r\nhow to install and run.\r\n\r\n</body>\r\n</html>\r\n")
;
// end
} catch (Exception ex) {
if (out.getBufferSize() != 0)
out.clearBuffer();
pageContext.handlePageException(ex);
} finally {
out.flush();
_jspxFactory.releasePageContext(pageContext);
}
}
}
--
※ 来源:·BBS 水木清华站 smth.org·[FROM: 159.226.41.166]
BBS水木清华站∶精华区