Home Blogs JavaFX JavaFX Performance Tips
JavaFX Performance Tips PDF Print E-mail
Written by Kuldip Pabla   
Monday, 15 June 2009 21:23
Article Index
JavaFX Performance Tips
Page 2
Page 3
All Pages

At KSPTech, a team of JavaFX developers spent over a couple of months developing Indaba Music's User Interface using JavaFX. What we learned during the development period was that subtle changes to your code can have huge impact on the performance of a JavaFX application. By making one or more of the following changes, we were able to improve user experience in a big way.

Many of you may already be aware of certain performance pitfalls like Binding. In this blog, I'll try to cover as many tips as I can, over the next few days.

 

Tip 1: def Instead of var

This is the simplest one and the most obvious one. Whenever value of a variable is not going to change, it makes sense to define it as constant using the def keyword instead of var Keyword.

 

Tip 2: Scope of a def/ var

This may sound very simple and obvious. However, many of us define variables in a larger scope than required. This could result into performance hits as well. Scope of a def/ var should be as narrow as possible. Also, local variable are resolved differently than public variables. Reason being a variable in some other class may in future bind to a public variable. As a result, public variables pay a little penalty as compared to local variables.

 



Last Updated on Saturday, 04 July 2009 16:02
 
Copyright © 2012 KSPTech Inc.. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.
 

Sponsors