java.exe比javaw.exe快

时间:2021-02-28 20:45:43

I've made several java software's using hibernate + Mysql/Sqlite and I have noticed a significant difference in fetch time (from database) when using both launchers.

我使用hibernate + Mysql / Sqlite制作了几个java软件,我注意到使用两个启动器时获取时间(来自数据库)的显着差异。

When I start my application using java.exe, of course a console is displayed but the application is faster than when I use javaw.exe .

当我使用java.exe启动我的应用程序时,当然会显示一个控制台,但应用程序比我使用javaw.exe时更快。

My application is a windows based application, and I don't want java.exe to load the console when the application starts, so I've been using javaw.exe, but it lacks in fetch time.

我的应用程序是一个基于Windows的应用程序,我不希望java.exe在应用程序启动时加载控制台,所以我一直在使用javaw.exe,但它缺少获取时间。

What's the explanation of that issue? And how can I either start my application using java.exe without starting a console, Or start it using javaw.exe and have the same performances?

这个问题的解释是什么?如何在不启动控制台的情况下使用java.exe启动应用程序,或者使用javaw.exe启动它并具有相同的性能?

Thanks in advance.

提前致谢。

1 个解决方案

#1


1  

Found the problem using VisualVM (profiler). Found out that there was logging instructions which were taking much time. Removed all logs as below:

使用VisualVM(探查器)发现问题。发现有记录说明需要花费很多时间。删除所有日志如下:

LogManager.getLogManager().getLogger("").setLevel(Level.OFF);

Thanks to fl0w.

感谢fl0w。

#1


1  

Found the problem using VisualVM (profiler). Found out that there was logging instructions which were taking much time. Removed all logs as below:

使用VisualVM(探查器)发现问题。发现有记录说明需要花费很多时间。删除所有日志如下:

LogManager.getLogManager().getLogger("").setLevel(Level.OFF);

Thanks to fl0w.

感谢fl0w。