<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Glavo,<br>
    </p>
    <div class="moz-cite-prefix">On 05/03/2025 17:09, Glavo wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJL5A3=N95xNK2=eicJ7GpR2Y058fL1vUMcFr+6aLGMeKZKJFA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">
                          <div dir="ltr">
                            <div dir="ltr">
                              <div dir="ltr">
                                <div dir="ltr">
                                  <div dir="ltr">
                                    <div dir="ltr">
                                      <div dir="ltr">
                                        <div dir="ltr">
                                          <div dir="ltr">
                                            <div dir="ltr">
                                              <div dir="ltr">Hi John,
                                                <div><br>
                                                </div>
                                                <div>The above feedback
                                                  is all for Windows,
                                                  and we have not tested
                                                  on other platforms
                                                  yet.</div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <p>Thanks for clarifying. I may be able to help a bit better then as
      I have a similar setup.</p>
    <blockquote type="cite"
cite="mid:CAJL5A3=N95xNK2=eicJ7GpR2Y058fL1vUMcFr+6aLGMeKZKJFA@mail.gmail.com">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">
                          <div dir="ltr">
                            <div dir="ltr">
                              <div dir="ltr">
                                <div dir="ltr">
                                  <div dir="ltr">
                                    <div dir="ltr">
                                      <div dir="ltr">
                                        <div dir="ltr">
                                          <div dir="ltr">
                                            <div dir="ltr">
                                              <div dir="ltr">
                                                <div><br>
                                                </div>
                                                <blockquote
                                                  class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On
                                                  Windows I really don't
                                                  expect that<br>
                                                  setting pulse higher
                                                  will do much (I posted
                                                  this a few days ago on
                                                  this<br>
                                                  list in response to
                                                  your earlier inquiry)</blockquote>
                                                <div><br>
                                                </div>
                                                <div>In fact,
                                                  setting the pulse
                                                  higher does have a
                                                  noticeable effect on
                                                  non-HiDPI screens.</div>
                                                <div>On my 1440p@120hz
                                                  monitor it works
                                                  perfectly and I can
                                                  clearly feel that it
                                                  no longer has the same
                                                  stuttering as it does
                                                  at 60fps.</div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <p>Could you check the clock resolution on your system when it works
      smoothly, you can use this tool:
      <a class="moz-txt-link-freetext" href="https://learn.microsoft.com/en-us/sysinternals/downloads/clockres">https://learn.microsoft.com/en-us/sysinternals/downloads/clockres</a></p>
    <p>This is unfortunately a global setting, and will greatly impact
      the thread scheduling on Windows systems.  It defaults to 15.625
      ms, but when something like a game or video is running, it may
      have been changed to a lower value; the value may differ for
      example on a fresh reboot, but be changed to a lower value when
      certain apps run. I expect that when it is set to the default, FX
      will not be able to do smooth 120 Hz displays as it relies on its
      thread being scheduled on time (but the default is only just
      sufficient for 60 Hz).  <br>
    </p>
    <blockquote type="cite"
cite="mid:CAJL5A3=N95xNK2=eicJ7GpR2Y058fL1vUMcFr+6aLGMeKZKJFA@mail.gmail.com">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">
                          <div dir="ltr">
                            <div dir="ltr">
                              <div dir="ltr">
                                <div dir="ltr">
                                  <div dir="ltr">
                                    <div dir="ltr">
                                      <div dir="ltr">
                                        <div dir="ltr">
                                          <div dir="ltr">
                                            <div dir="ltr">
                                              <div dir="ltr">
                                                <div>But when DPI
                                                  scaling is used, the
                                                  60fps stutter
                                                  reappears and the
                                                  frame rate of the
                                                  JavaFX application is
                                                  significantly lower
                                                  than that of other
                                                  windows.</div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <p>Could this be simply that more work needs to be done and JavaFX
      is not keeping up on a high DPI screen?  I've noticed that when I
      run my app full screen on 1920x1200 vs 3840x2160 (one at 100%, the
      other at 150%) that the second runs somewhat slower, but it has to
      display 4x the pixels... if you suspect display scaling is the
      issue, you could temporarily set the display to 100% and try
      again.<br>
    </p>
    <blockquote type="cite"
cite="mid:CAJL5A3=N95xNK2=eicJ7GpR2Y058fL1vUMcFr+6aLGMeKZKJFA@mail.gmail.com">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">
                          <div dir="ltr">
                            <div dir="ltr">
                              <div dir="ltr">
                                <div dir="ltr">
                                  <div dir="ltr">
                                    <div dir="ltr">
                                      <div dir="ltr">
                                        <div dir="ltr">
                                          <div dir="ltr">
                                            <div dir="ltr">
                                              <div dir="ltr">
                                                <div><br>
                                                </div>
                                                <blockquote
                                                  class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">As
                                                  for the NVIDIA
                                                  problem; I doubt that
                                                  setting
                                                  "javafx.animation.pulse"<br>
                                                  can have any effect on
                                                  this. You may want to
                                                  look further as to why
                                                  this<br>
                                                  problem occurs.</blockquote>
                                                <div><br>
                                                </div>
                                                <div>This feedback comes
                                                  from our users.
                                                  Specifically, we added
                                                  the following code to
                                                  the application main
                                                  method:</div>
                                                <div><br>
                                                </div>
                                                <blockquote
                                                  class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">System.getProperties().putIfAbsent("javafx.animation.pulse",
                                                  "120");</blockquote>
                                                <div><br>
                                                </div>
                                                <div>So users can
                                                  override the value by
                                                  adding JVM arguments.</div>
                                                <div><br>
                                                </div>
                                                <div>We told the user to
                                                  try adding the JVM
                                                  argument `-Djavafx.animation.pulse=60`,
                                                  and the user later
                                                  told us that this
                                                  solved his problem.</div>
                                                <div>So we think this is
                                                  the result of
                                                  adjusting this
                                                  property.</div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <p>Yes, I understand; there is just nothing in the code that would
      explain this; it's not like this value is used to change any
      hardware settings, it is just a value that is used to increment a
      long value that keeps track of the frame time we need to send to
      animation code. <br>
    </p>
    <p>--John<br>
    </p>
    <blockquote type="cite"
cite="mid:CAJL5A3=N95xNK2=eicJ7GpR2Y058fL1vUMcFr+6aLGMeKZKJFA@mail.gmail.com">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">
                          <div dir="ltr">
                            <div dir="ltr">
                              <div dir="ltr">
                                <div dir="ltr">
                                  <div dir="ltr">
                                    <div dir="ltr">
                                      <div dir="ltr">
                                        <div dir="ltr">
                                          <div dir="ltr">
                                            <div dir="ltr">
                                              <div dir="ltr">
                                                <div><br>
                                                </div>
                                                <div>Glavo</div>
                                                <div> </div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <div class="gmail_quote gmail_quote_container">
        <div dir="ltr" class="gmail_attr">On Wed, Mar 5, 2025 at
          11:09 PM John Hendrikx <<a
            href="mailto:john.hendrikx@gmail.com" moz-do-not-send="true"
            class="moz-txt-link-freetext">john.hendrikx@gmail.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi
          Glavo,<br>
          <br>
          On which platform is this?  On Windows I really don't expect
          that<br>
          setting pulse higher will do much (I posted this a few days
          ago on this<br>
          list in response to your earlier inquiry).  It may trigger
          more frames<br>
          to be rendered, but their animation times will not use correct
          values<br>
          resulting in it just rendering duplicate frames or frames with
          only<br>
          slight differences (and not the expected 1/120 difference).<br>
          <br>
          On the Windows platform I think we need to do some more work
          to get<br>
          animations >60 Hz -- specifically, the FX thread needs to
          be scheduled<br>
          reliably at intervals lower than 15 ms, which is non-trivial
          on Windows.<br>
          <br>
          As for the NVIDIA problem; I doubt that setting
          "javafx.animation.pulse"<br>
          can have any effect on this. You may want to look further as
          to why this<br>
          problem occurs.<br>
          <br>
          --John<br>
          <br>
          On 05/03/2025 07:41, Glavo wrote:<br>
          > We tried setting javafx.animation.pulse to 120 in our
          JavaFX application.<br>
          > After a few days of collecting feedback, we found the
          following issues<br>
          ><br>
          > * Animation frame rate does not seem to be improved on
          HiDPI screens<br>
          > on Windows.<br>
          > * JavaFX applications prevent NVIDIA Advanced Optimus
          from<br>
          > automatically selecting graphics cards when
          javafx.animation.pulse is set.<br>
          ><br>
          > Glavo<br>
        </blockquote>
      </div>
    </blockquote>
  </body>
</html>