浅谈Jfinal急速开发框架
2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>
使用Jfinal一段時(shí)間了,記得當(dāng)初14年吧,為了建立一個(gè)簡單的門戶網(wǎng)站,想找個(gè)輕量型的急速開發(fā)框架,然后搜到Jfinal,然后用了一段時(shí)間后,確實(shí)不錯(cuò), 現(xiàn)在吧,隨著時(shí)間的推移,作者對JFinal的版本迭代也是一直在努力,一直朝著優(yōu)秀的方向走去;
這里做下對Jfinal的使用記錄;
為什么要用Jfinal:?
- 輕: 輕到什么程度呢, 體積小,框架僅339K,且無第三方依賴
- 快
- 開發(fā)快:?粘貼復(fù)制就是可以做到簡單的模塊增刪改查;
- 啟動(dòng)快: 內(nèi)置jetty啟動(dòng),直接運(yùn)行main方法就可以啟動(dòng)整個(gè)web項(xiàng)目
- 編譯快: 熱編譯的支持,更是讓jfianl使用者留下更多的時(shí)間陪家人
- 便捷
- 支持Validator后端校驗(yàn)
- AOP支持,攔截器配置靈活便捷
- Plugin體系結(jié)構(gòu),擴(kuò)展性強(qiáng),比如兼容spring定時(shí)器什么的也可以做到(當(dāng)然,不推薦使用xml的方式)
- 無xml配置,框架接口簡單明了
- 學(xué)習(xí)成本低,上手快,,這才是重點(diǎn);節(jié)約更多的時(shí)間可以去陪戀人,家人
說了Jfinal的好處,那么Jfinal到底適合哪些應(yīng)用場景呢,適合多大的運(yùn)行項(xiàng)目呢;
適合中小型項(xiàng)目,這主要是針對一些業(yè)務(wù)處理不是很復(fù)雜的項(xiàng)目;
- ???????看表?? ? 200來張表 ,可以定位中型項(xiàng)目吧
- ????????? ? ? 看代碼量 ? ?(未知)
- ???????????????? ? ? 物理大小 ? (未知)
? ???????看案例吧,具體說也難說, 看到的才最明了,?以下是Jfinal做的一些項(xiàng)目:
????http://www.ysshow.com?
????http://www.666ys.cn?
等等
關(guān)于性能及訪問壓力測試
- 100 個(gè)線程并發(fā),20000次請求 ab -n 20000 -c 100 http://202.114.79.246:8280/portal/login?username=zhangsan\&password=123 This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0 Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright 2006 The Apache Software Foundation, http://www.apache.org/Benchmarking 202.114.79.246 (be patient) Completed 2000 requests Completed 4000 requests Completed 6000 requests Completed 8000 requests Completed 10000 requests Completed 12000 requests Completed 14000 requests Completed 16000 requests Completed 18000 requests Finished 20000 requestsServer Software: Apache-Coyote/1.1 Server Hostname: 202.114.79.246 Server Port: 8280Document Path: /portal/login?username=zhangsan&password=123 Document Length: 2412 bytesConcurrency Level: 100 Time taken for tests: 2.754403 seconds Complete requests: 20000 Failed requests: 0 Write errors: 0 Total transferred: 53053260 bytes HTML transferred: 48252060 bytes Requests per second: 7261.10 [#/sec] (mean) Time per request: 13.772 [ms] (mean) Time per request: 0.138 [ms] (mean, across all concurrent requests) Transfer rate: 18809.52 [Kbytes/sec] receivedConnection Times (ms)min mean[+/-sd] median max Connect: 0 1 2.0 2 9 Processing: 2 11 3.4 11 51 Waiting: 0 5 3.6 5 38 Total: 2 13 3.8 13 53Percentage of the requests served within a certain time (ms)50% 1366% 1475% 1580% 1590% 1795% 1898% 1999% 29100% 53 (longest request)
- 100 個(gè)線程并發(fā),30000 次請求 ab -n 30000 -c 100 http://202.114.79.246:8280/portal/login?username=zhangsan\&password=123 This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0 Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright 2006 The Apache Software Foundation, http://www.apache.org/Benchmarking 202.114.79.246 (be patient) Completed 3000 requests Completed 6000 requests Completed 9000 requests Completed 12000 requests Completed 15000 requests Completed 18000 requests Completed 21000 requests Completed 24000 requests Completed 27000 requests Finished 30000 requestsServer Software: Apache-Coyote/1.1 Server Hostname: 202.114.79.246 Server Port: 8280Document Path: /portal/login?username=zhangsan&password=123 Document Length: 2412 bytesConcurrency Level: 100 Time taken for tests: 4.336593 seconds Complete requests: 30000 Failed requests: 0 Write errors: 0 Total transferred: 79581216 bytes HTML transferred: 72379296 bytes Requests per second: 6917.87 [#/sec] (mean) Time per request: 14.455 [ms] (mean) Time per request: 0.145 [ms] (mean, across all concurrent requests) Transfer rate: 17920.98 [Kbytes/sec] receivedConnection Times (ms)min mean[+/-sd] median max Connect: 0 2 1.8 2 10 Processing: 1 11 3.3 12 56 Waiting: 0 5 3.4 5 51 Total: 2 13 3.6 14 57Percentage of the requests served within a certain time (ms)50% 1466% 1575% 1580% 1690% 1795% 1898% 1999% 28100% 57 (longest request)
- ?200 個(gè)線程并發(fā),10 萬次請求 ab -n 100000 -c 200 http://202.114.79.246:8280/portal/login?username=wangkai\&password=123 This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0 Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright 2006 The Apache Software Foundation, http://www.apache.org/Benchmarking 202.114.79.246 (be patient) Completed 10000 requests Completed 20000 requests Completed 30000 requests Completed 40000 requests Completed 50000 requests Completed 60000 requests Completed 70000 requests Completed 80000 requests Completed 90000 requests Finished 100000 requestsServer Software: Apache-Coyote/1.1 Server Hostname: 202.114.79.246 Server Port: 8280Document Path: /portal/login?username=wangkai&password=123 Document Length: 2411 bytesConcurrency Level: 200 Time taken for tests: 15.194965 seconds Complete requests: 100000 Failed requests: 0 Write errors: 0 Total transferred: 265219295 bytes HTML transferred: 241208495 bytes Requests per second: 6581.13 [#/sec] (mean) Time per request: 30.390 [ms] (mean) Time per request: 0.152 [ms] (mean, across all concurrent requests) Transfer rate: 17045.32 [Kbytes/sec] receivedConnection Times (ms)min mean[+/-sd] median max Connect: 0 10 147.1 3 3019 Processing: 1 18 7.0 18 228 Waiting: 0 8 6.7 8 220 Total: 4 29 147.4 21 3047Percentage of the requests served within a certain time (ms)50% 2166% 2475% 2680% 2790% 3095% 3398% 3799% 43100% 3047 (longest request) ?
相對于 struts2 性能提升 8 倍左右,相對 spring 性能提升兩倍多,只要服務(wù)器性能好并且沒有數(shù)據(jù)庫或其它瓶頸,并發(fā) 1000 以上不是問題;
不過,Jfinal只不過是你整個(gè)架構(gòu)的一部分,并發(fā)訪問量承受能力完全取決于你的整體架構(gòu)如何;
官方并沒有給出具體數(shù)據(jù),以上數(shù)據(jù)類型是截至開源社區(qū)中的內(nèi)容;?
沒有對比就沒有傷害(Jfinal PK springMVC)
- 開發(fā)效率至少比spring快三倍以上(主要由于熱編譯,啟動(dòng)快,結(jié)構(gòu)簡單,無xml)
- Jfinal?Db + Record模式,靈活便利 ,維護(hù)量少
- spring 本身就很厚重,在加上ser/get封裝類,維護(hù)麻煩
- 同樣是添加Validator后端校驗(yàn),springMVC配置則要麻煩的多?
- 更多的就需要你自己去體驗(yàn)了
以上對比是在開發(fā)中小型(業(yè)務(wù)不復(fù)雜)項(xiàng)目的時(shí)實(shí)際經(jīng)驗(yàn)總結(jié); ?
?
?
轉(zhuǎn)載于:https://my.oschina.net/java1314/blog/793473
總結(jié)
以上是生活随笔為你收集整理的浅谈Jfinal急速开发框架的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: vue2.0的学习
- 下一篇: 人工智能能够构建一个自主驱动云吗?