英文:
mvn spring-boot:run vs java -jar xxx.jar performance difference
问题
在我的项目中,我使用 Spring Boot 和 JSF。当我从IDE(eclipse)启动我的Web应用程序,或者使用 'mvn spring-boot:run' 命令时,没有任何问题,响应时间非常快。但是,当我使用 'mvn clean install' 命令打包我的应用程序,然后运行 'java -jar myapp.war',有时处理简单任务会花费很长时间。例如,打开一个包含一些来自后端bean的数据的对话框页面,通常需要200毫秒,但有时却需要7秒钟。这个问题的原因是什么?
注:我只在使用打包的fat .war文件运行时遇到这个问题。
英文:
In my project i use spring-boot with jsf. When i start my web application from IDE(eclipse) or using 'mvn spring-boot:run' command there is no problem response time is very good. But when i package my app with ' mvn clean install ' and than run 'java -jar myapp.war' sometimes it takes too long time to process simple jobs. For example opening a dialog page with some data from backing bean, normally takes 200 msec but sometimes it takes 7 secs. What can it be the cause of this problem ?
Not: I face this problem only running it with packaged fat .war file.
专注分享java语言的经验与见解,让所有开发者获益!
评论