<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p style="direction: ltr; margin-top: 0px; margin-bottom: 0px;"><span style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">> What trade off are you making here?  It seems we're trading a small memory
 gain for more CPU use (extra indirection, walking a list linearly to find the correct property on each use/access VS no indirection, no list walking).</span></p>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
You are right.  The tradeoff is non-zero memory gain (a few megabytes, to the tune of maybe 5% of total heap size) at the cost of extra CPU cycles.  The rationale is that even though we consume extra CPU, it's much less noticeable because of the cache-friendly
 implementation and non-zero positive impact on garbage collector (less memory to scan).</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<p style="direction: ltr; margin-top: 0px; margin-bottom: 0px;"><span style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">> Are the resource constrained platforms you named generally memory or CPU constrained?</span></p>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I asked Gluon for some feedback on iOS/Android.  However, my previous experience with a large trading application says that memory footprint savings outweighs the CPU cycles, so I would imagine we'll get a net gain even on the desktop.</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<p style="direction: ltr; margin-top: 0px; margin-bottom: 0px;"><span style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">> Have you investigated a breakdown of JavaFX memory use, and did the amount
 of memory used by properties come out on top here?</span></p>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
There is some statistics provided in <a href="https://github.com/andy-goryachev-oracle/Test/blob/main/doc/Experiments/NodeProperties.md" data-outlook-id="9074576b-7c43-438e-a9d5-ea05048e66cd">
https://github.com/andy-goryachev-oracle/Test/blob/main/doc/Experiments/NodeProperties.md</a> , please take a look.</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<p style="direction: ltr; margin-top: 0px; margin-bottom: 0px;"><span style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">> Would the gains you made here become irrelevant or less relevant with Compact
 Object Headers [<a href="https://openjdk.org/jeps/519" class="moz-txt-link-freetext" data-outlook-id="6cb8835d-b6f1-4268-bdc5-acb387ef1fbb" style="margin-top: 0px; margin-bottom: 0px;">https://openjdk.org/jeps/519</a>]</span></p>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Compact Object Headers are almost irrelevant here - the stats that were collected count the number of pointers saved (assumed 8 bytes per pointer on 64 bit).  The stats ignore any other possible savings.</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<p style="direction: ltr; margin-top: 0px; margin-bottom: 0px;"><span style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">> I think the property look-up system cannot reasonably be List (FastMap despite
 its name is a List). Converting this to a map however is likely to require a small object (like Map.Entry) which will further reduce any gains you made here I think.</span></p>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The FastMap is a map-like (key-value) storage, even though it's implemented as an array.  There is a debate as to what would the most efficient implementation entail (a hashmap, one array, or two arrays like the POC currently uses).  The idea is not to put
<b>all</b>​ the properties into the container, but only the rarely used ones, with the end result of having a few (less than 4-6, say).  This makes the object small and cache-friendly, which further speeds up the access.</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks!</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
-andy</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="mail-editor-reference-message-container">
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr;">
</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="text-align: left; padding: 3pt 0in 0in; border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) currentcolor currentcolor; font-family: Aptos; font-size: 12pt; color: black;">
<b>From: </b>openjfx-dev <openjfx-dev-retn@openjdk.org> on behalf of John Hendrikx <john.hendrikx@gmail.com><br>
<b>Date: </b>Thursday, February 19, 2026 at 15:28<br>
<b>To: </b>openjfx-dev@openjdk.org <openjfx-dev@openjdk.org><br>
<b>Subject: </b>Re: Experiment: Node properties<br>
<br>
</div>
<p class="ms-outlook-mobile-reference-message skipProofing"><br>
</p>
<div class="moz-cite-prefix">On 04/02/2026 22:17, Andy Goryachev wrote:</div>
<blockquote>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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 class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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>
</blockquote>
<p class="ms-outlook-mobile-reference-message skipProofing">What trade off are you making here?  It seems we're trading a small memory gain for more CPU use (extra indirection, walking a list linearly to find the correct property on each use/access VS no indirection,
 no list walking).</p>
<p class="ms-outlook-mobile-reference-message skipProofing">Are the resource constrained platforms you named generally memory or CPU constrained?</p>
<p class="ms-outlook-mobile-reference-message skipProofing">Have you investigated a breakdown of JavaFX memory use, and did the amount of memory used by properties come out on top here?</p>
<p class="ms-outlook-mobile-reference-message skipProofing">Would the gains you made here become irrelevant or less relevant with Compact Object Headers [<a href="https://openjdk.org/jeps/519" class="moz-txt-link-freetext" data-outlook-id="6cb8835d-b6f1-4268-bdc5-acb387ef1fbb" style="margin-top: 0px; margin-bottom: 0px;">https://openjdk.org/jeps/519</a>]</p>
<p class="ms-outlook-mobile-reference-message skipProofing"><br>
</p>
<blockquote>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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>
</blockquote>
<p class="ms-outlook-mobile-reference-message skipProofing">I like the idea, but I wonder if there really is much to gain here, and whether those gains will hold up with future Java improvements.</p>
<p class="ms-outlook-mobile-reference-message skipProofing">I think the property look-up system cannot reasonably be List (FastMap despite its name is a List). Converting this to a map however is likely to require a small object (like Map.Entry) which will
 further reduce any gains you made here I think.</p>
<p class="ms-outlook-mobile-reference-message skipProofing">--John</p>
<blockquote>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Cheers,</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
-andy</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>References</b></div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[0] <a href="https://github.com/andy-goryachev-oracle/Test/blob/main/doc/Experiments/NodeProperties.md" class="moz-txt-link-freetext" data-outlook-id="217ca979-74ae-4107-9a0b-bf3cf23cb5ec">
https://github.com/andy-goryachev-oracle/Test/blob/main/doc/Experiments/NodeProperties.md</a></div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt;">
<br>
</div>
</blockquote>
</div>
</body>
</html>