Re: Resizing stage creates delays in platform.runLater pool?

2014-06-02 Thread Richard Bair
My guess would be that the number of resize events is swamping the event queue.

 On Jun 2, 2014, at 7:20 AM, Guillaume Anctil drakk...@gmail.com wrote:
 
 Hi,
 
 I have encountered severe lag in my application when resizing the stage
 while an animation is running.
 
 I've made this very simple example code to reproduce the issue:
 https://github.com/Drakkoon/LWJGL-FX/blob/master/src/JavaFXResizeTest.java
 
 This is only a tread that acquires a semaphore, prints the
 System.nanotime() delta and releases the semaphore. There's a button on the
 stage that can clicked on to start a fade animation and stop it.
 
 Resizing the stage while it is animating will create huge deltas in the
 thread. Stopping the animation brings everything back to normal. Restarting
 the animation once resized and stopped does not create the huge deltas
 until you resize again.
 
 Does anyone know what is at play here, what underlying system creates the
 lag and how to avoid this?
 
 Thanks.


Re: Resizing stage creates delays in platform.runLater pool?

2014-06-02 Thread Guillaume Anctil
It might be something like that. But it seems to be in the platform, not
application related.

When detecting a resize, I tried putting the thread to sleep for a long
amount of time. Something like 5 seconds before adding a new Runnable in
the Platform.runLater queue. It's still very slow when it starts again.
(Only when there's an animation running).

Could it be that the animation pulse + resize swamps he queue and it never
gets back to full speed again? Does the pulse have a high priority? The
fade animation on the button never seems to slow down.


On Mon, Jun 2, 2014 at 10:23 AM, Richard Bair richard.b...@oracle.com
wrote:

 My guess would be that the number of resize events is swamping the event
 queue.

  On Jun 2, 2014, at 7:20 AM, Guillaume Anctil drakk...@gmail.com wrote:
 
  Hi,
 
  I have encountered severe lag in my application when resizing the stage
  while an animation is running.
 
  I've made this very simple example code to reproduce the issue:
 
 https://github.com/Drakkoon/LWJGL-FX/blob/master/src/JavaFXResizeTest.java
 
  This is only a tread that acquires a semaphore, prints the
  System.nanotime() delta and releases the semaphore. There's a button on
 the
  stage that can clicked on to start a fade animation and stop it.
 
  Resizing the stage while it is animating will create huge deltas in the
  thread. Stopping the animation brings everything back to normal.
 Restarting
  the animation once resized and stopped does not create the huge deltas
  until you resize again.
 
  Does anyone know what is at play here, what underlying system creates the
  lag and how to avoid this?
 
  Thanks.



Re: Resizing stage creates delays in platform.runLater pool?

2014-06-02 Thread Anthony Petrov

You may be hitting this bug: https://javafx-jira.kenai.com/browse/RT-36796

Please try running with -Dprism.order=sw and see if this changes anything.

--
best regards,
Anthony

On 6/2/2014 6:20 PM, Guillaume Anctil wrote:

Hi,

I have encountered severe lag in my application when resizing the stage
while an animation is running.

I've made this very simple example code to reproduce the issue:
https://github.com/Drakkoon/LWJGL-FX/blob/master/src/JavaFXResizeTest.java

This is only a tread that acquires a semaphore, prints the
System.nanotime() delta and releases the semaphore. There's a button on the
stage that can clicked on to start a fade animation and stop it.

Resizing the stage while it is animating will create huge deltas in the
thread. Stopping the animation brings everything back to normal. Restarting
the animation once resized and stopped does not create the huge deltas
until you resize again.

Does anyone know what is at play here, what underlying system creates the
lag and how to avoid this?

Thanks.



Re: Resizing stage creates delays in platform.runLater pool?

2014-06-02 Thread Guillaume Anctil
Yes. -Dprism.order=sw does fix the issue. Looking at that bug's sample code
and how to reproduce, it looks very similar.

Thank you. I'll run it in software mode for now and see how bad it affects
performance. I can always apply a hacky workaround of stopping animations
when I detect a resize and restarting them once the resize is done.

So I guess this is on your radar, and it is being looked into?


On Mon, Jun 2, 2014 at 10:43 AM, Anthony Petrov anthony.pet...@oracle.com
wrote:

 You may be hitting this bug: https://javafx-jira.kenai.com/browse/RT-36796

 Please try running with -Dprism.order=sw and see if this changes anything.

 --
 best regards,
 Anthony


 On 6/2/2014 6:20 PM, Guillaume Anctil wrote:

 Hi,

 I have encountered severe lag in my application when resizing the stage
 while an animation is running.

 I've made this very simple example code to reproduce the issue:
 https://github.com/Drakkoon/LWJGL-FX/blob/master/src/
 JavaFXResizeTest.java

 This is only a tread that acquires a semaphore, prints the
 System.nanotime() delta and releases the semaphore. There's a button on
 the
 stage that can clicked on to start a fade animation and stop it.

 Resizing the stage while it is animating will create huge deltas in the
 thread. Stopping the animation brings everything back to normal.
 Restarting
 the animation once resized and stopped does not create the huge deltas
 until you resize again.

 Does anyone know what is at play here, what underlying system creates the
 lag and how to avoid this?

 Thanks.




Re: Resizing stage creates delays in platform.runLater pool?

2014-06-02 Thread Stephen F Northover
I suggest you add yourself to the bug.  At this time, we are not sure 
what is causing it.  It could be graphics or event queue related as 
there is evidence that changing either solves the problem.


Steve

On 2014-06-02, 10:51 AM, Guillaume Anctil wrote:

Yes. -Dprism.order=sw does fix the issue. Looking at that bug's sample code
and how to reproduce, it looks very similar.

Thank you. I'll run it in software mode for now and see how bad it affects
performance. I can always apply a hacky workaround of stopping animations
when I detect a resize and restarting them once the resize is done.

So I guess this is on your radar, and it is being looked into?


On Mon, Jun 2, 2014 at 10:43 AM, Anthony Petrov anthony.pet...@oracle.com
wrote:


You may be hitting this bug: https://javafx-jira.kenai.com/browse/RT-36796

Please try running with -Dprism.order=sw and see if this changes anything.

--
best regards,
Anthony


On 6/2/2014 6:20 PM, Guillaume Anctil wrote:


Hi,

I have encountered severe lag in my application when resizing the stage
while an animation is running.

I've made this very simple example code to reproduce the issue:
https://github.com/Drakkoon/LWJGL-FX/blob/master/src/
JavaFXResizeTest.java

This is only a tread that acquires a semaphore, prints the
System.nanotime() delta and releases the semaphore. There's a button on
the
stage that can clicked on to start a fade animation and stop it.

Resizing the stage while it is animating will create huge deltas in the
thread. Stopping the animation brings everything back to normal.
Restarting
the animation once resized and stopped does not create the huge deltas
until you resize again.

Does anyone know what is at play here, what underlying system creates the
lag and how to avoid this?

Thanks.






Re: Resizing stage creates delays in platform.runLater pool?

2014-06-02 Thread Werner Lehmann
We also experienced laggy animation with a stage slide out/down 
animation. The animation would change stage size and it appeared to have 
only 2 or 3 frames. Workaround was to use a different animation style: 
keep stage size but move it 20 px down while changing opacity from low 
to full, both animated. Maybe this is an option for you, too.


Werner

On 02.06.2014 16:20, Guillaume Anctil wrote:

Does anyone know what is at play here, what underlying system creates the
lag and how to avoid this?


Re: Resizing stage creates delays in platform.runLater pool?

2014-06-02 Thread Stephen F Northover
Does running with the software pipeline fix the problem as suggested in 
https://javafx-jira.kenai.com/browse/RT-36796 ?


Steve

On 2014-06-02, 11:10 AM, Werner Lehmann wrote:
We also experienced laggy animation with a stage slide out/down 
animation. The animation would change stage size and it appeared to 
have only 2 or 3 frames. Workaround was to use a different animation 
style: keep stage size but move it 20 px down while changing opacity 
from low to full, both animated. Maybe this is an option for you, too.


Werner

On 02.06.2014 16:20, Guillaume Anctil wrote:
Does anyone know what is at play here, what underlying system creates 
the

lag and how to avoid this?




Re: Resizing stage creates delays in platform.runLater pool?

2014-06-02 Thread Werner Lehmann
Probably not (that code is gone so I don't know for sure). For some 
other (Mac-related) reason, the software pipeline was already used for 
our internal testing. Didn't seem to make a difference.


FWIW, there was also an NPE occurring if someone was crazy enough to 
show that popup many times by clicking on the button which triggers it - 
while the previous animation did not yet finish. I think two animations 
were competing over the same animated properties if that is even 
possible. Anyway, not an issue anymore.


Werner

On 02.06.2014 17:16, Stephen F Northover wrote:

Does running with the software pipeline fix the problem as suggested in
https://javafx-jira.kenai.com/browse/RT-36796 ?

Steve