亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

java - spring是不是相比其他框架要慢一些?
巴扎黑
巴扎黑 2017-04-18 10:55:40
0
11
1335

用springMVC開發(fā)了一個在線考試系統(tǒng)。后臺用了Spring+SpringMvc,其他還用了SpringSecure。

除了服務器,其他客戶端載入一個頁面,看了下時間大約在70ms左右,不含載入后用post請求的一堆數(shù)據(jù)。重復刷新或者去其他頁面也都是要等70ms左右才能加載完頁面。頁面靜態(tài)資源緩存已開。

這個70ms左右的時間有辦法減少嗎?謝謝!

巴扎黑
巴扎黑

reply all(11)
Peter_Zhu

Each request takes 70 milliseconds, so 1 CPU core can only handle 1000/70=14 requests per second, and 4 CPU cores can only handle 56 requests. To be honest, it is already quite slow. Make another one In comparison, when using PHP7+OPcache to run WordPress on Ubuntu (i5-3230M), one CPU core processes one WordPress homepage request (no cache needs to be checked in the database), and it only takes 28 milliseconds. You must know that WordPress has poor performance. PHP program.

So, I think each request must take at least 10 milliseconds or less to be considered fast. After all, Nginx only takes 1 millisecond to display a directory list of the root directory of a website.

黃舟

In fact, 70ms is not too slow for web applications.

If you think it affects the user experience, compare it with pure HttpServlet. There are many factors that affect page loading time. Long delays are not necessarily caused by Spring MVC, but are related to factors such as containers and browsers.

黃舟

It also has something to do with the code you write. . .

Ty80

You still have to look at the code and the actual situation, if it is entirely because the response speed of that request is too slow. Generally, the best optimization for small systems is to add a cache to reduce database requests and fetch data directly from memory. This will be much faster!

伊謝爾倫

I suggest you take a look at this: https://my.oschina.net/xiangg...

左手右手慢動作

This is mainly related to Spring’s view rendering mechanism. You can refer to: http://www.cnblogs.com/davidw...

洪濤

Let’s put it this way, it may be fast to write simple pages directly using Servlet, but when you finish all the functions yourself, you may find that it is not even as fast as SpringMVC, and many of the functions you do are actually SpringMVC Wait until the framework already exists.

迷茫

I don’t think it’s too slow

劉奇

70ms It’s still relatively fast, as this amount of time is completely insensitive to the user.

巴扎黑

Separate the front-end and back-end, and then cache the GET request. Of course 70ms is already very fast.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template