Hi Tom, I am wondering whether it is really necessary to provide special API for this case or whether this is not just an implementation issue of controls like the TabPane.
For performance reasons (not only CSS-processing) I normally track selection changes in TabPanes and similar controls and then explicitly remove all invisible branches from the scene graph and keep them elsewhere so that I can re-attach them if needed. But I also do this tracking for a second reason because I also want to tell my model which tab is visible so that I can shut down all processing in my model which only updates properties which are only used in the currently invisible branches of the scene graph. I think if currently invisible branches of the scene graph are explicitly detached from it, this does also solve your original problem of reparenting, doesn't it? It would however be nice if the TabPane would do the detaching/attaching itself. Michael Am 20.01.17 um 11:43 schrieb Tom Schindl:
Hi, One of the biggest problems when working with JavaFX is that if you reparent a big portion of the SceneGraph is that a full CSS-Pass is applied on all reparented SG-Nodes even if those nodes are currently not visible (eg. because they are part of a TabPane). I general I think it is ok to also applyCSS changes on currently not visible nodes (eg they still have an influence on layout-bounds) but there are situations like the above mentioned example of TabPane that it is unnecessary overhead to apply applyCSS changes on those parts of the SG until they get visible. I would not mind if the CSS-Pass on JavaFX would be as performant as the one from current browsers but unfortunately it isn't so I'd like to discuss the possibility of a API to *temporarily* exclude portions of the SG from CSS-Passes. In JavaFX8 i was able to hack that in by overwriting impl_processCSS in a subclass who changed to doProcessCSS who now is private so my hack does not work anymore. To give you an impression on what performance gains we are talking about just look at the video I recorded - https://tomsondev.bestsolution.at/2016/11/25/improving-minmax-performance-in-e4-on-javafx-applications/ Tom
