Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Java was once notoriously slow and still has slower JVM startup time than C++. Maybe JavaFX is slower. I’ve not written any GUI applications in java nor do I use many java applications. However, my experience with C++ has been very different: things can run and start very fast. If they don’t, it’s because either you did something very wrong or because it’s doing a lot of work that would be equally slow elsewhere.

I’ve used Qt, WxWidgets, FLTK, GTK+ and a FOX as my GUI toolkit over the years and, for my small applications, all of those start so fast I don’t notice it. The only slowdown I’ve noticed is with Qt when using QtQuick (I assume because it has to load, parse and then execute QML — essentially JavaScript — as well as the C++ code). It’s still faster starting up than PyCharm and Photoshop for anything that I’ve used it for.



Qt slows down when it processes [large] images. Anything you want to display on screen has to be processed to a QtPixmap structure. When I last used it, with sufficiently large textures and/or splash screen images, this operation could take long enough to cause the rendering thread to skip frames. (In an embedded x86 environment we were talking about some hundreds of milliseconds.)

The other part where Qt can really slow down is when you have to instantiate a 3D driver module. That can block absolutely everything.


Ive always wondered why java starts so slow. A simple hello world takes a second or so. Most interpreted languages do a lot better.

Once it has warmed up, it's close to C however.


A simple hello world takes about 262ms on Windows 10 with Java 11.

Which can be further reduced by making use of AOT compiler, or SubstrateVM.

Additionally, Java always enjoyed the ability to AOT compile to native code, even though it was mostly available via third party commercial JDKs, or gcj for the adventurous ones.


>Once it has warmed up

that's the problem, a lot of workflows even on really complex applns like photoshop are firing up a project for a couple of minutes to get some output or correct something. enough time is wasted warming up that people who can afford it just leave the applications running. i just keep whatever VS project i'm working on running for eg coz the startup times are painful and i have RAM to spare


Interestingly enough, since we have Qt mentioned in this thread...

Somewhere between 4.8 and 5.1 (I can't remember exactly when), QtWebKit introduced a compile-time macro-assembler setup. This was used to generate a "first pass" product of the JIT engine output, to reduce the JavaScript engine warmup time.[ß]

This was at a time when I had already wondered aloud, on several occasions, how long it would take for browser vendors to allow downloading precompiled JIT blobs for speeding up the most expensive parts of whatever they wanted their visitors to run. This never happened. The world hopped over the fledgling JS-AOT craze and came up with WebAssembly instead.

ß: the construction also introduced Ruby as a build requirement, because of course the macro-assembler generation was done with Ruby.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: