淺談Jfinal急速開發框架

2019獨角獸企業重金招聘Python工程師標準>>> hot3.png

使用Jfinal一段時間了,記得當初14年吧,為了建立一個簡單的門戶網站,想找個輕量型的急速開發框架,然后搜到Jfinal,然后用了一段時間后,確實不錯, 現在吧,隨著時間的推移,作者對JFinal的版本迭代也是一直在努力,一直朝著優秀的方向走去;

這里做下對Jfinal的使用記錄;

為什么要用Jfinal:?

  • 輕: 輕到什么程度呢, 體積小,框架僅339K,且無第三方依賴
    • 開發快:?粘貼復制就是可以做到簡單的模塊增刪改查;
    • 啟動快: 內置jetty啟動,直接運行main方法就可以啟動整個web項目
    • 編譯快: 熱編譯的支持,更是讓jfianl使用者留下更多的時間陪家人
  • 便捷
    • 支持Validator后端校驗
    • AOP支持,攔截器配置靈活便捷
    • Plugin體系結構,擴展性強,比如兼容spring定時器什么的也可以做到(當然,不推薦使用xml的方式)
    • 無xml配置,框架接口簡單明了
  • 學習成本低,上手快,,這才是重點;節約更多的時間可以去陪戀人,家人

說了Jfinal的好處,那么Jfinal到底適合哪些應用場景呢,適合多大的運行項目呢;

適合中小型項目,這主要是針對一些業務處理不是很復雜的項目;

  • ???????看表?? ? 200來張表 ,可以定位中型項目吧
  • ????????? ? ? 看代碼量 ? ?(未知)
  • ???????????????? ? ? 物理大小 ? (未知)

? ???????看案例吧,具體說也難說, 看到的才最明了,?以下是Jfinal做的一些項目:

????http://www.ysshow.com?

????http://www.666ys.cn?

等等

關于性能及訪問壓力測試

  • 100 個線程并發,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 個線程并發,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 個線程并發,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 性能提升兩倍多,只要服務器性能好并且沒有數據庫或其它瓶頸,并發 1000 以上不是問題;

不過,Jfinal只不過是你整個架構的一部分,并發訪問量承受能力完全取決于你的整體架構如何;

官方并沒有給出具體數據,以上數據類型是截至開源社區中的內容;?

沒有對比就沒有傷害(Jfinal PK springMVC)

  • 開發效率至少比spring快三倍以上(主要由于熱編譯,啟動快,結構簡單,無xml)
  • Jfinal?Db + Record模式,靈活便利 ,維護量少
  • spring 本身就很厚重,在加上ser/get封裝類,維護麻煩
  • 同樣是添加Validator后端校驗,springMVC配置則要麻煩的多?
  • 更多的就需要你自己去體驗了

以上對比是在開發中小型(業務不復雜)項目的時實際經驗總結; ?

?

?

轉載于:https://my.oschina.net/java1314/blog/793473

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/542191.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/542191.shtml
英文地址,請注明出處:http://en.pswp.cn/news/542191.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

make 怎么降級_Ubuntu 中將 make 的版本降低

最新的 Ubuntu 版本使用的是 make 版本是 4.0.在編譯 Android4.4 源碼包時&#xff0c;由于 make 版本過高&#xff0c;命令提示行會提示編譯 Android4.4 源碼包需要 make 的版本為 3.81 或 3.82.build/core/main.mk:42: ****************************************************…

Java ObjectOutputStream writeChar()方法與示例

ObjectOutputStream類writeChar()方法 (ObjectOutputStream Class writeChar() method) writeChar() method is available in java.io package. writeChar()方法在java.io包中可用。 writeChar() method is used to write 2 bytes of a character value. writeChar()方法用于寫…

虛擬機的管理

我們采用虛擬機的原因是什么呢&#xff0c;很簡單就倆字&#xff1a; 節能 1. 管理虛擬機的命令&#xff1a; virt-manager開啟虛擬機管理器virsh list顯示正在運行的虛擬機virsh list --all查看所有虛擬機virsh start desktop打開虛擬機virsh shutdown desktop正常關閉虛擬機…

mybatis對java自定義注解的使用——入門篇

轉自&#xff1b;https://www.cnblogs.com/sonofelice/p/4980161.html 1. 最近在學習spring和ibatis框架。 以前在天貓實習時做過的一個小項目用到的mybatis&#xff0c;在其使用過程中&#xff0c;不加思索的用了比較原始的一種持久化方式&#xff1a; 在一個包中寫一個DAO的接…

Java BigDecimal toBigIntegerExact()方法(帶示例)

BigDecimal類的toBigIntegerExact()方法 (BigDecimal Class toBigIntegerExact() method) toBigIntegerExact() method is available in java.math package. toBigIntegerExact()方法在java.math包中可用。 toBigIntegerExact() method is used to convert this BigDecimal int…

Linux中的軟件管理

1. 使用已有的網絡安裝資源安裝軟件 cd /etc/yum.repos.d/ (移動到yum源指向的文件配置目錄下&#xff09; vim westos.repo &#xff08;新建文件&#xff0c;yum下后綴必須為.repo) 編輯這個文件里面寫 [redhat] &#xff08;軟件倉庫名稱&#xff09; namefirefox &#x…

楚留香ai人臉識別_戴口罩居然也能人臉識別?這些AI黑科技真的藏不住了.........

當人工智能遇見影像技術&#xff0c;將會釋放出多少意想不到的巨大能量&#xff1f;「喔圖知圖實驗室」瞄準當下的影像痛點&#xff0c;持續發力升級AI黑科技&#xff0c;帶來兩大必殺技——人臉識別再度升級、AI智能旋轉校正。戴口罩也能識別——人臉識別升級戴口罩人臉識別如…

android--------Popupwindow的使用

2019獨角獸企業重金招聘Python工程師標準>>> PopupWindow在Android.widget包下&#xff0c;項目中經常會使用到PopupWindow做菜單選項&#xff0c; PopupWindow這個類用來實現一個彈出框&#xff0c;可以使用任意布局的View作為其內容&#xff0c;這個彈出框是懸浮…

使用JavaScript中的示例的escape()函數

While transferring the data over the network or sometimes while saving data to the database, we need to encode the data. The function escape() is a predefined function in JavaScript, which encodes the given string. 在通過網絡傳輸數據或有時將數據保存到數據庫…

安裝虛擬機的腳本

1. 先安裝生成自動安裝腳本的工具 yum install system-config-kickstart -y 2. 打開這個軟件 system-config-kickstart 基本設置&#xff1a;更改時區為上海&#xff0c;設置root用戶密碼 2&#xff09;設置安裝方法為網絡安裝&#xff0c;將共享的鏡像文件地址正確填寫 3&…

小小小游戲

寫著玩 FlappyBird 視頻:https://pan.baidu.com/s/1sljIR5z 游戲:https://pan.baidu.com/s/1ge8j7Ej 項目:https://pan.baidu.com/s/1eSysxpw Breakout 視頻:https://pan.baidu.com/s/1gfhv4hd 項目:https://pan.baidu.com/s/1hs8xPly QBert 視頻:https://pan.baidu.com/s/1s…

go在方法中修改結構體的值_[Go]結構體及其方法

結構體類型可以包含若干字段&#xff0c;每個字段通常都需要有確切的名字和類型。也可以不包含任何字段&#xff0c;這樣并不是沒有意義的&#xff0c;因為還可以為這些類型關聯上一些方法&#xff0c;這里可以把方法看作事函數的特殊版本。函數事獨立的程序實體&#xff0c;可…

to_number用法示例_Number()函數以及JavaScript中的示例

to_number用法示例Number()函數 (Number() function) Number() function is a predefined global function in JavaScript, it used to convert an object to the number. If the function is not able to convert the object in a number – it returns "NaN". (Rea…

系統延時任務及定時任務

1. 系統延時任務&#xff1a; at相關命令 at time 設定任務執行時間at> rm -fr /mnt/* 任務動作at> <EOT> <<ctrld 執行任務at的命令&#xff1a; -l ##查看任務列表-c …

cpn tools查看運行時間_Jmeter在Linux下的運行測試

一、JMeterApache JMeter是Apache組織開發的基于Java的壓力測試工具。用于對軟件做壓力測試&#xff0c;它最初被設計用于Web應用測試&#xff0c;但后來擴展到其他測試領域。1.1、JMeter的作用能夠對HTTP和FTP服務器進行壓力和性能測試&#xff0c; 也可以對任何數據庫進行同樣…

css div滾動_如何使用CSS創建可垂直滾動的div?

css div滾動Introduction: 介紹&#xff1a; Dealing with divs has become a regularity and divs are used for many purposes like to structure our code and to segregate our various sections of codes. Besides, we are also aware of many properties that we can im…

Linux中磁盤分區的管理

1. 本地存儲設備的識別 fdisk -l真實存在的設備cat /proc/partitions系統識別的設備blkid系統可使用的設備df系統正在掛載的設備 真實存在的設備不一定可識別&#xff0c;識別到的的設備不一定可使用 2. 設備的掛載和卸載 1&#xff09;設備名稱 /dev/xdx …

python中時間的加減_python日期加減

python中關于時間和日期函數的常用計算總結 python中關于時間和日期函數有time和datatime 1.獲取當前時間的兩種方法: import datetime,time now = time.strftime("%Y-%m-%d %H:%M:%S") print now now = datetime.datetime.now()... 文章 技術小胖子 2017-11-08 848…

bst 刪除節點_在BST中刪除大于或等于k的節點

bst 刪除節點Problem statement: 問題陳述&#xff1a; Given a BST and a value x, write a function to delete the nodes having values greater than or equal to x. The function will return the modified root. 給定一個BST和一個值x &#xff0c;編寫一個函數刪除值大…

游戲架構之二(轉)

棋牌類游戲常用架構&#xff1a; 我從事過4年的棋牌類游戲開發&#xff0c;使用過的架構大致如上&#xff0c;各模塊解釋如下。 LoginServer&#xff1a; 登陸服務器&#xff0c;主要負責player 的登陸請求&#xff0c;驗證player的合法性&#xff0c;為合法的player分配sessio…