Hi! Just for the records: My test included the JVM startup time. Yours start counting in main() where the JVM is already up - and probably some of the classpath scanning already took place because of the inheritance from „javafx.application.Application“ . Your test shows „showing: 298 shown: 468“ on my machine.
A „native“ splash screen usually should start up at the very first, before the JVM starts. Best regards, Mario > Am 05.06.2018 um 19:04 schrieb Weiqi Gao <weiqi...@gmail.com>: > > Here's a more accurate (but still rough) timing application: > > import javafx.application.Application; > import javafx.stage.Stage; > import javafx.scene.Scene; > import javafx.scene.control.*; > import javafx.scene.layout.*; > > public class Main extends Application { > private static long t1; > private static long t2; > private static long t3; > private static long t4; > > public void start(Stage stage) { > t2 = System.currentTimeMillis(); > Label l1 = new Label("main: " + t1); > Label l2 = new Label("start: " + (t2 - t1)); > Label l3 = new Label(""); > Label l4 = new Label(""); > VBox vbox = new VBox(l1, l2, l3, l4); > Scene scene = new Scene(vbox); > stage.setScene(scene); > stage.setTitle("Timing Demo"); > stage.setOnShowing(e -> { > t3 = System.currentTimeMillis(); > l3.setText("showing: " + (t3 - t2) + ", " + (t3 - t1)); > }); > stage.setOnShown(e -> { > t4 = System.currentTimeMillis(); > l4.setText("shown: " + (t4 - t3) + ", " + (t4 - t1)); > }); > stage.show(); > } > > public static void main(String[] args) { > t1 = System.currentTimeMillis(); > launch(args); > } > } > > The result of running it on my Dell laptop with Intel Core i7-6820HQ > @2.70GHz,CPU and NVIDIA Quadro M1000M display adapter is attached: > > Essentially, it took less than half a second for a dead simple JavaFX Stage > to be visible. > > Here's the timing number for 10 consecutive runs: 422, 440, 426, 442, 418, > 441, 432, 444, 470, 453 > > -- > Weiqi Gao > weiqi...@gmail.com > > On Tue, Jun 5, 2018 at 10:46 AM, Scott Palmer <swpal...@gmail.com> wrote: > >> Yes, my only comment was that if we can get a window up using standard Java >> GUI frameworks fast enough, then the complexity of adding splashscreen >> support to the launcher isn't justified. >> Mario's example shows that is it 1-2 seconds to get a window up. That is a >> bit high. If it was under 1s then I would suggest not bothering, it isn't, >> so keep it on the list of desired features. >> >> Scott >> >> On Tue, Jun 5, 2018 at 8:21 AM Pedro Duque Vieira < >> pedro.duquevie...@gmail.com> wrote: >> >>> Sorry, perhaps it was I who misunderstood the debate.. >>> >>> On Mon, Jun 4, 2018 at 4:06 PM, Michael Paus <m...@jugs.org> wrote: >>> >>>> Maybe I misunderstood the question but to my opinion the real question >> is >>>> whether the new java packager has to provide the support for a splash >>>> screen >>>> or not. This has nothing to do with the question whether applications >>>> should >>>> have a splash screen or not because if we find that todays Java is fast >>>> enough >>>> to display a simple window in less than a second or so, then the Java >> GUI >>>> (Swing or JavaFX) could provide a splash screen itself. There is then >> no >>>> need >>>> for an additional mechanism provided my the packager. >>>> >>>> Am 04.06.18 um 16:44 schrieb Pedro Duque Vieira: >>>> >>>> Hi, >>>>> >>>>> I agree with Johan and others, a splash screen is valuable and needed. >>>>> >>>>> Microsoft applications that run on Windows itself (think Word, Excel, >>>>> etc), >>>>> they have a splash screen, Intelllij has a splash screen (it's swing >>> based >>>>> AFAIK), etc.. If a Microsoft application running on its own operating >>>>> system needs a splash screen then chances are pretty high that there >>> will >>>>> be Java apps that'll need a splash screen. >>>>> >>>>> Cheers, >>>>> >>>>> >>>>> >>>> >>> >>> >>> -- >>> Pedro Duque Vieira >>> >> > > > > -- > Weiqi Gao (高为奇) > weiqi...@gmail.com > http://weiqigao.blogspot.com/