现在的开源框架都是大而全,动辄xxMB的jar包,感觉用不了那么多的功能,而且性能有些不尽如人意。所以还是自己造个轮子吧。
firefly的特性
firefly的使用风格类似Spring3,具体可以看
http://code.google.com/p/firefly/wiki/guide
代码已经发布到 google code ,有兴趣的同学可以一起来开发
http://code.google.com/p/firefly/
往JSP打印“你好 firefly!”
500线程,循环2次
取跑10次之后的成绩
框架 | 版本 | 吞吐量 | 错误率 |
fireflyMVC | 1.0-SNAPSHOT | 38910.506/分钟 | 0% |
Servlet | 2.5 | 38022.814/分钟 | 0% |
Spring3MVC | 3.0.5.RELEASE | 13106.16/分钟 | 0% |
Struts2 | 2.2.1.1 | 1256.571/分钟 | 0% |
往JSP打印“你好 firefly!”
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>firefly</title> </head> <body> ${hello} </body> </html>
@RequestMapping(value = "/hello") public String index(HttpServletRequest request) { request.setAttribute("hello", "你好 firefly!"); return "/index.jsp"; }
@Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setAttribute("hello", "你好 firefly!"); request.getRequestDispatcher("/WEB-INF/page/index.jsp").forward( request, response); }
@RequestMapping(value="/spring", method=RequestMethod.GET) public String index(HttpServletRequest request) { request.setAttribute("hello", "你好 firefly!"); return "/index"; }
public String execute() throws Exception { setMessage("你好 firefly!"); return SUCCESS; }