造了个轮子^_^,firefly应用程序框架,性能大幅超越spring3MVC和Struts2,含测试报告...

现在的开源框架都是大而全,动辄xxMB的jar包,感觉用不了那么多的功能,而且性能有些不尽如人意。所以还是自己造个轮子吧。

 

firefly的特性

  • 高性能,性能大幅超越spring3、struts2等,详情请看性能测试报告
  • 精简、轻量、无侵入,firefly.jar只有44k
  • core包含IOC、MVC、Interceptor等常用功能
  • 使用简单,基于约定优于配置的思想,默认使用Annotation配置方式

 

firefly的使用风格类似Spring3,具体可以看

http://code.google.com/p/firefly/wiki/guide

 

代码已经发布到 google code ,有兴趣的同学可以一起来开发

http://code.google.com/p/firefly/

 

 

测试环境

  • windows7 jdk1.6.0_22
  • JDK参数:-Xms128m -Xmx512m -XX:+DisableExplicitGC
  • 服务器:jetty 6.1.25
  • CPU: T6600 内存:3G
  • 测试工具:JMeter

用例1测试报告

往JSP打印“你好 firefly!”

500线程,循环2次

取跑10次之后的成绩

框架版本吞吐量错误率
fireflyMVC1.0-SNAPSHOT38910.506/分钟0%
Servlet2.538022.814/分钟0%
Spring3MVC3.0.5.RELEASE13106.16/分钟0%
Struts22.2.1.11256.571/分钟0%

 

用例1

往JSP打印“你好 firefly!”

JSP代码

<!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>

 

firefly测试代码

        @RequestMapping(value = "/hello")
        public String index(HttpServletRequest request) {
                request.setAttribute("hello", "你好 firefly!");
                return "/index.jsp";
        }

 

Servlet测试代码

        @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);
        }

 

Spring3MVC测试代码

        @RequestMapping(value="/spring", method=RequestMethod.GET)
        public String index(HttpServletRequest request) {
                request.setAttribute("hello", "你好 firefly!");
                return "/index";
        }

 

Struts2测试代码

    public String execute() throws Exception {
        setMessage("你好 firefly!");
        return SUCCESS;
    }

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值