java.exe is faster than javaw.exe

593 Views Asked by At

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.

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 .

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.

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?

Thanks in advance.

1

There are 1 best solutions below

0
On BEST ANSWER

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

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

Thanks to fl0w.