<html><body><div style="font-family: 'verdana'; font-size: 12px; color: #000;"><span style="background-color: #ffffff;">I also like the idea. I, once had a similar idea but not enough time to do a deep check. In my opinion, we should make as much lazy as possible, as subclasses and developers often just use a small set of properties really. <br><br></span>What I also had a look back then is default values for properties, like focusTraversable. Right now, changing default values (via the setter) in the constructor will initialize the property, even if otherwise we never need it (like pickOnBounds, focusTraversable, ...). Back then, I thought about improving this by using a mechanism which is already there (but not implemented consistently and used everywhere), that is methods like Control.getInitialFocusTraversable(), which could work in a way without initializing this 100 of times (like in case of Cell).</div>
<div style="font-family: 'verdana'; font-size: 12px; color: #000;"> </div>
<div style="font-family: 'verdana'; font-size: 12px; color: #000;">So maybe, we can save a bit more by not initializing properties by (essentially) changing the default value of it (therefore the getter).</div>
<div style="font-family: 'verdana'; font-size: 12px; color: #000;">Calling the getter in most cases in JavaFX does not yet initialize the property itself.</div>
<div style="font-family: 'verdana'; font-size: 12px; color: #000;"> </div>
<div style="font-family: 'verdana'; font-size: 12px; color: #000;">The biggest benefits will probably be tables, as they have rows (cells) with cells, that can add up quite fast with many columns. Running more optimized on a RaspberryPi is also good thing.</div>
<div style="font-family: 'verdana'; font-size: 12px; color: #000;"> </div>
<div style="font-family: 'verdana'; font-size: 12px; color: #000;">-- Marius</div>
<div id="sub-body-container" style="margin: 10px 5px 5px 10px; padding: 10px 0px 10px 10px; border-left: 2px solid rgb(195, 217, 229);">
<div style="margin: 0px 0px 10px;">
<div><strong>Gesendet: </strong>Mittwoch, 4. Februar 2026 um 22:17</div>
<div><strong>Von: </strong>"Andy Goryachev" <andy.goryachev@oracle.com></div>
<div><strong>An: </strong>OpenJFX <openjfx-dev@openjdk.org></div>
<div><strong>Betreff: </strong>Experiment: Node properties</div>
</div>
<div style="direction: ltr; font-family: 'Iosevka Fixed SS16' , Arial , Helvetica , sans-serif; font-size: 12.0pt; color: #000000;">I would like to share the results of a little experiment involving optimization of storage of Node properties.  The basic idea is to create a compact fast map-like container to hold the rarely instantiated properties in order to reduce the application memory footprint.</div>
<div style="direction: ltr; font-family: 'Iosevka Fixed SS16' , Arial , Helvetica , sans-serif; font-size: 12.0pt; color: #000000;"> </div>
<div style="direction: ltr; font-family: 'Iosevka Fixed SS16' , Arial , Helvetica , sans-serif; font-size: 12.0pt; color: #000000;">The savings are not overwhelming, but not exactly zero.  I would imagine this optimization might be more interesting in any resource constrained environment such as Android / iOS / RaspberryPi.  Please refer to [0] for the details.</div>
<div style="direction: ltr; font-family: 'Iosevka Fixed SS16' , Arial , Helvetica , sans-serif; font-size: 12.0pt; color: #000000;"> </div>
<div style="direction: ltr; font-family: 'Iosevka Fixed SS16' , Arial , Helvetica , sans-serif; font-size: 12.0pt; color: #000000;">I encourage you to try it with your application, to see whether you notice any change in memory consumption and/or performance.  Let me know what you think!</div>
<div style="direction: ltr; font-family: 'Iosevka Fixed SS16' , Arial , Helvetica , sans-serif; font-size: 12.0pt; color: #000000;"> </div>
<div style="direction: ltr; font-family: 'Iosevka Fixed SS16' , Arial , Helvetica , sans-serif; font-size: 12.0pt; color: #000000;">Cheers,</div>
<div style="direction: ltr; font-family: 'Iosevka Fixed SS16' , Arial , Helvetica , sans-serif; font-size: 12.0pt; color: #000000;">-andy</div>
<div style="direction: ltr; font-family: 'Iosevka Fixed SS16' , Arial , Helvetica , sans-serif; font-size: 12.0pt; color: #000000;"> </div>
<div style="direction: ltr; font-family: 'Iosevka Fixed SS16' , Arial , Helvetica , sans-serif; font-size: 12.0pt; color: #000000;"> </div>
<div style="direction: ltr; font-family: 'Iosevka Fixed SS16' , Arial , Helvetica , sans-serif; font-size: 12.0pt; color: #000000;"><strong>References</strong></div>
<div style="direction: ltr; font-family: 'Iosevka Fixed SS16' , Arial , Helvetica , sans-serif; font-size: 12.0pt; color: #000000;"> </div>
<div style="direction: ltr; font-family: 'Iosevka Fixed SS16' , Arial , Helvetica , sans-serif; font-size: 12.0pt; color: #000000;">[0] <a href="https://github.com/andy-goryachev-oracle/Test/blob/main/doc/Experiments/NodeProperties.md" target="_blank" rel="noopener noreferrer"> https://github.com/andy-goryachev-oracle/Test/blob/main/doc/Experiments/NodeProperties.md</a></div>
<div style="direction: ltr; font-family: 'Iosevka Fixed SS16' , Arial , Helvetica , sans-serif; font-size: 12.0pt;"> </div>
</div></body></html>