temporary performance issues when prism.dirtyopts set to false

Jose Martinez jmartine_1026 at yahoo.com
Sat Jun 9 06:07:20 PDT 2012

Ok the issue with the ghost images of the projectiles (RT-22126) has been isolated.  When I was creating my many PathTransitions I used a function called getPath that takes as input a list of Point2D.  The problem was that I was adding the first point in that list twice into the Path, once as a MoveTo and again as a LineTo.  I suspect this screwed up the ORTHOGONAL_TO_TANGENT, since obtaining the angle from point 1 to point 2 might have resulted in a value of NaN.

I will post this to the ticket.  Unfortunately I failed to reproduce in test code.  In test code I entered the same Point2D multiple times into the beginning of my Path (one MoveTo and multiple LineTo's) but the problem did not happen.  Either way it is fixed in my production code (one line fix).

While a fix for this that messes up performance is unadvised maybe a check for duplicate subsequent PathElement property values when the PathElements are being entered into the Path might be worth considering.... does not matter to me since now I know to be more cognizant of this :-)


 From: Kevin Rushforth <kevin.rushforth at oracle.com>
To: Jose Martinez <jmartine_1026 at yahoo.com> 
Cc: Pavel Safrata <pavel.safrata at oracle.com>; "openjfx-dev at openjdk.java.net" <openjfx-dev at openjdk.java.net> 
Sent: Thursday, June 7, 2012 8:08 AM
Subject: Re: temporary performance issues when prism.dirtyopts set to false
Yes, sorry for not making that clear when I asked you to set it to help narrow down the problem. We do not intend that prism.dirtyopts, or any other debugging flag be used in production by an application.

-- Kevin

Jose Martinez wrote:
> Ok I follow, that's a good
 point.  Will fill two out for the problems I am seeing when ditryopts is set to true.... didn't realize ditryopts set to false is only for testing.
> Thank you!
> jose
> ________________________________
>  From: Pavel Safrata <pavel.safrata at oracle.com>
> To: openjfx-dev at openjdk.java.net Sent: Thursday, June 7, 2012 1:58 AM
> Subject: Re: temporary performance issues when prism.dirtyopts set to false
>  Hi Jose,
> Jonathan is absolutely right. Disabling dirty opts is a good tool for narrowing the problem, but you should never want to do it for public use. The performance is significantly worse and will always be. The application must render the same screens with and without dirty
 opts and if it doesn't, there is a bug in FX that needs to be fixed immediately. Could you please file one?
> Thanks,
> Pavel
> On 7.6.2012 6:21, Jose Martinez wrote:
>> Thanks for the response.  Please note that the poor performance is only temporary, during the first minute of game play.  So I suspect there is hope to obtain good performance for the whole time.
>>   jose
>> ________________________________
>>    From: Jonathan Giles<jonathan.giles at oracle.com>
>> To: Jose Martinez<jmartine_1026 at yahoo.com>
>> Cc: openjfx mailing list<openjfx-dev at openjdk.java.net>
>> Sent: Thursday, June 7, 2012 12:04 AM
>> Subject: Re: temporary performance issues when prism.dirtyopts set to false
>> I am not in the graphics team, but given the present state of timezones I thought I'd reply to try to give some clarity. Hopefully someone will follow this up at a more suitable hour with a correct answer :-)
>> Dirty opts in JavaFX is synonymous with the concept known as dirty rectangles, I believe. You can learn more about dirty rectangles at [1]. Basically it is an optimisation designed to limit the amount of drawing on the screen to only the areas that have changed since the last update. If dirty opts are disabled, as you are doing, you are basically telling JavaFX to redraw the whole screen on every pulse. This is clearly a far more expensive operation than just drawing the 'dirty'
>> So, in short, yes, this is a known issue with disabling dirty opts. Except it really isn't an issue - it is just the nature of things. The reason why Kevin asked for you to disable dirty opts was to try to trouble shoot the other issues you raised. You shouldn't go without dirty opts if at all possible.
>> [1] http://c2.com/cgi/wiki?DirtyRectangles
>> -- Jonathan
>> On 7/06/2012 3:56 p.m., Jose Martinez wrote:
>>> Hello,
>>> I notice performance issues when prism.dirtyopts is set to false.  But it only happens during the first minute or so of game play.  The animation is not smooth, it looks as if it has a low frame rate.  But after a minute the animations becomes smooth for the rest of the
 program execution.  The poor animation performance returns if I restart the application.
>>> Is this a known issue?
>>>      thanks
>>> jose

More information about the openjfx-dev mailing list