<!DOCTYPE html>
<!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">
You could look into the com. sun. javafx. css. FixedCapacitySet code I wrote before. It features: - Single and dual entry versions (very fast and a common case I suppose for what you are proposing) - Array version without hashing (up to a tunable</div>
<!-- Preheader Text : END -->
<!-- Email Banner : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerStart</div>
<!--[if ((ie)|(mso))]>
<table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding: 0px 0px 10px 0px; direction: ltr" lang="en"><tr><td>
<table border="0" cellspacing="0" cellpadding="0" style="padding: 0px 8px 6px 8px; width: 100%; border-radius:4px; border-top:4px solid #8193a0;background-color:#60beeb;"><tr><td valign="top">
<table align="left" border="0" cellspacing="0" cellpadding="0" style="padding: 0px 8px 4px 8px; font-size: 12px; line-height: 16px">
<tr><td style="color:#000000; font-family: 'Arial', sans-serif; font-weight:bold; font-size:14px; line-height: 20px; direction: ltr">
This Message Is From an External Sender
</td></tr>
<tr><td style="color:#000000; font-weight:normal; font-family: 'Arial', sans-serif; font-size:12px; direction: ltr">
This message came from outside your organization.
</td></tr>
</table>
<![if ie]><br clear="all"><![endif]>
<table align="right" border="0" cellspacing="0" cellpadding="0" style="padding: 0px 0px 4px 0px; font-size: 14px; line-height: 36px"><tr>
<td style="direction: ltr"> <a target="_blank" href="https://us-phishalarm-ewt.proofpoint.com/EWT/v1/ACWV5N9M2RV99hQ!NB2wnCkEsEhkddPgvbkemDM3EwJhR-rXnEsmQRVC_Lq7pk1dXXKchi6Hk-CScqnQVoDXa594u_ZVlWh7ZoRE0gYETMmmmavqnT4VThE$" style="mso-padding-alt: 7px; padding: 7px; border-radius: 2px; border: 1px solid #666666; "><strong style="font-weight: normal; color: #000000; text-decoration: none; font-family: 'Arial', sans-serif; font-size: 14px;"> Report Suspicious </strong></a> </td>
</tr></table>
</td></tr></table>
</td></tr></table>
<![endif]-->
<![if !((ie)|(mso))]>
<div dir="ltr" lang="en" id="pfptBannerdt4qto0" style="all: revert !important; display:block !important; text-align: left !important; margin: 0 0 10px 0 !important; padding:7px 16px 8px 16px !important; border-radius: 4px !important; min-width: 200px !important; background-color: #60beeb !important; background-color: #60beeb; border-top: 4px solid #8193a0 !important; border-top: 4px solid #8193a0;">
<div id="pfptBannerdt4qto0" style="all: unset !important; float:left !important; display:block !important; margin: 1px 0 1px 0 !important; max-width: 600px !important;">
<div id="pfptBannerdt4qto0" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #60beeb !important; color:#000000 !important; color:#000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-weight:bold !important; font-weight:bold; font-size:14px !important; line-height:1.29 !important; line-height:1.29">
This Message Is From an External Sender
</div>
<div id="pfptBannerdt4qto0" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #60beeb !important; color:#000000 !important; color:#000000; font-weight:normal; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size:12px !important; line-height:1.5 !important; line-height:1.5; margin-top:2px !important;">
This message came from outside your organization.
</div>
</div>
<div id="pfptBannerdt4qto0" style="all: unset !important; float: right !important; display: block !important; display: block; margin-left: 16px !important; margin-top: 1px !important; text-align: right !important; width: fit-content !important; font-size: 12px !important">
<a id="pfptBannerdt4qto0" href="https://us-phishalarm-ewt.proofpoint.com/EWT/v1/ACWV5N9M2RV99hQ!NB2wnCkEsEhkddPgvbkemDM3EwJhR-rXnEsmQRVC_Lq7pk1dXXKchi6Hk-CScqnQVoDXa594u_ZVlWh7ZoRE0gYETMmmmavqnT4VThE$"
style="all: unset !important; display: inline-block !important; text-decoration: none">
<div class="pfptPrimaryButtondt4qto0" style="display: inline-block !important; display: inline-block; visibility: visible !important; opacity: 1 !important; color: #000000 !important; color: #000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size: 14px !important; font-weight: normal !important; text-decoration: none !important; border-radius: 2px !important; margin-top: 3px !important; margin-bottom: 3px !important; margin-left: 16px !important; padding: 7.5px 16px !important; white-space: nowrap !important; width: fit-content !important;
border: 1px solid #666666">
Report Suspicious
</div>
</a>
</div>
<div style="clear: both !important; display: block !important; visibility: hidden !important; line-height: 0 !important; font-size: 0.01px !important; height: 0px"> </div>
</div>
<![endif]>
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerEnd</div>
<!-- Email Banner : END -->
<!-- BaNnErBlUrFlE-BoDy-end -->
<html>
<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
#pfptBannerdt4qto0 { all: revert !important; display: block !important;
visibility: visible !important; opacity: 1 !important;
background-color: #60beeb !important;
max-width: none !important; max-height: none !important }
.pfptPrimaryButtondt4qto0:hover, .pfptPrimaryButtondt4qto0:focus {
background-color: #77a8c4 !important; }
.pfptPrimaryButtondt4qto0:active {
background-color: #8193a0 !important; }
html:root, html:root>body { all: revert !important; display: block !important;
visibility: visible !important; opacity: 1 !important; }
</style>
<!-- BaNnErBlUrFlE-HeAdEr-end -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>You could look into the com.sun.javafx.css.FixedCapacitySet code
I wrote before. It features:</p>
<p>- Single and dual entry versions (very fast and a common case I
suppose for what you are proposing)<br>
- Array version without hashing (up to a tunable number of
elements, 10 I believe)<br>
- Open addressed hash version (uses an array, not Map.Entry), very
low memory use for a hash table, unlimited elements, O(1)
performance, faster than HashMap (HashMap shines in write
performance, which we don't really need here).<br>
- Relatively simple implementation because it is read-only (no
add/remove or restructuring logic needed).<br>
<br>
All that you'd need to do is make a Map version of it, and do a
"copy on write" approach if a property needs adding (which should
be rare, and should eventually stop occurring, so one can
basically ignore that cost).<br>
<br>
Main benefit is that this will perform really fast for the most
likely cases, and "degrades" to map-like O(1) performance with a
hash. This lowers the barrier for adding even more properties,
even if a bit more commonly used.<br>
</p>
<p>Hashing will be fast as we're talking about properties, which
have no hashCode/equals implementation, so you get the default.</p>
<p>If you want I could adapt it to be a map, and to have "copy on
write" semantics.</p>
<p>--John<br>
</p>
<div class="moz-cite-prefix">On 25/02/2026 21:25, Andy Goryachev
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CY8PR10MB7265ACD22B6E7DBB30A6F9D3E575A@CY8PR10MB7265.namprd10.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div
style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
John brings a good point about effects on performance, and no
amount of explanation from both sides of the argument are going
to help. I believe the performance of small arrays will be
surprisingly better than a hash table, but the only way to
resolve this question is to measure. I am planning to test it
and will certainly share the results.</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);">
If you are willing to try it out, you could run your app with
jfx build from the branches mentioned earlier (I've synced them
up with the latest master).</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);">
To measure the heap consumption changes, you can use VisualVM,
make sure to set FastMap.COLLECT_STATISTICS to false. With
statistics enabled, you'll see some stdout but those are just
estimates, so I wouldn't trust them much.</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);">
Measuring the impact of performance is more difficult. One test
that might get <i>
some</i> idea is to time the startup of the app, since it
involves massive creation of Nodes, application of CSS, and many
other things in a burst. It's probably best to launch several
times and pick the best time, to reduce the effect of disk
caches etc.</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);">
Also, keep in mind that, theoretically, there are more
properties that can be classified as "rare", so we might see
even more improvement should we deem this idea worthwhile.</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);">
Another benefit is that it will be easier to add convenience
properties instead of constructing Subscription chains.</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);">
Let us know what you find out.</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);">
-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 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>Marius Hanl <a class="moz-txt-link-rfc2396E" href="mailto:mariushanl@web.de"><mariushanl@web.de></a><br>
<b>Date: </b>Wednesday, February 25, 2026 at 11:01<br>
<b>To: </b><a class="moz-txt-link-abbreviated" href="mailto:john.hendrikx@gmail.com">john.hendrikx@gmail.com</a>
<a class="moz-txt-link-rfc2396E" href="mailto:john.hendrikx@gmail.com"><john.hendrikx@gmail.com></a>, Andy Goryachev
<a class="moz-txt-link-rfc2396E" href="mailto:andy.goryachev@oracle.com"><andy.goryachev@oracle.com></a>, <a class="moz-txt-link-abbreviated" href="mailto:openjfx-dev@openjdk.org">openjfx-dev@openjdk.org</a>
<a class="moz-txt-link-rfc2396E" href="mailto:openjfx-dev@openjdk.org"><openjfx-dev@openjdk.org></a><br>
<b>Subject: </b>Re: [External] : Re: Experiment: Node
properties<br>
<br>
</div>
<div dir="ltr" id="pfptBannerej0nkli"
style="visibility: visible !important; opacity: 1 !important; max-width: none !important; max-height: none !important; display: block !important; text-align: left !important; margin: 0px 0px 10px !important; padding: 7px 16px 8px !important; border-radius: 4px !important; min-width: 200px !important; background-color: rgb(96, 190, 235); border-top-width: 4px !important; border-top-style: solid !important; border-top-color: rgb(129, 147, 160) !important;"
lang="en">
<div id="pfptBannerej0nkli"
style="visibility: visible !important; opacity: 1 !important; background-color: rgb(96, 190, 235); max-height: none !important; float: left !important; display: block !important; margin: 1px 0px !important; max-width: 600px !important;">
<div id="pfptBannerej0nkli"
style="opacity: 1 !important; max-width: none !important; max-height: none !important; display: block !important; visibility: visible !important; background-color: rgb(96, 190, 235); color: rgb(0, 0, 0); font-family: Arial, sans-serif !important; font-weight: bold !important; font-size: 14px !important; line-height: 1.29 !important;">
This Message Is From an Untrusted Sender</div>
<div id="pfptBannerej0nkli"
style="font-weight: normal; opacity: 1 !important; max-width: none !important; max-height: none !important; display: block !important; visibility: visible !important; background-color: rgb(96, 190, 235); color: rgb(0, 0, 0); font-family: Arial, sans-serif !important; font-size: 12px !important; line-height: 1.5 !important; margin-top: 2px !important;">
You have not previously corresponded with this sender.</div>
</div>
<div id="pfptBannerej0nkli"
style="visibility: visible !important; opacity: 1 !important; background-color: rgb(96, 190, 235); max-width: none !important; max-height: none !important; float: right !important; display: block !important; margin-left: 16px !important; margin-top: 1px !important; text-align: right !important; width: fit-content !important; font-size: 12px !important;">
<div class="pfptPrimaryButtonej0nkli"
style="white-space: nowrap; margin-top: 3px; margin-bottom: 3px; margin-left: 16px; padding: 7.5px 16px; border-width: 1px; border-style: solid; border-color: rgb(102, 102, 102); border-radius: 2px; width: fit-content; display: inline-block; font-family: Arial, sans-serif; font-size: 14px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(96, 190, 235);"><a
href="https://us-phishalarm-ewt.proofpoint.com/EWT/v1/ACWV5N9M2RV99hQ!P92y3kIlEUDHNjoglxNe8W35-VFyXSOZUhFd19FhWbbhvLXCLQjEuwQjFsPmBDAC5oo8MYkWp56ID_EXmbsVoEXn0ha_sPZIVqpwHIWOUGbDNs5chWugVxtHCnuulc1NfT37q6FfJ5sJIeXiGHyBMy8FywkueD6HBh2Z2lgRphe1M3LGN5uSITi0$"
id="pfptBannerej0nkli"
data-outlook-id="a75a534f-862b-44f8-9610-c204c82452e3"
style="text-decoration: none; display: inline-block; background-color: rgb(96, 190, 235); max-width: none; max-height: none;"
moz-do-not-send="true">Report Suspicious</a></span></div>
</div>
<div
style="line-height: 0; height: 0px; display: block; font-size: 0.01px;"> </div>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing"
style="font-family: verdana; font-size: 12px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);">I also
agree with John here. Especially regarding the lookup, we
should definitely use a hash based algorithm (HashMap?) with
a reasonable default size.</span></div>
<div class="ms-outlook-mobile-reference-message skipProofing"
style="font-family: verdana; font-size: 12px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);">hashCode
really is not expensive, but we should recheck. </span></div>
<div class="ms-outlook-mobile-reference-message skipProofing"
style="font-family: verdana; font-size: 12px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);"> </span></div>
<div class="ms-outlook-mobile-reference-message skipProofing"
style="font-family: verdana; font-size: 12px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);">@Andy,
when you did the changes / rechecked, I would be happy to
test it with some applications.<br>
I usually set the compact object headers in those
applications as well, so we will see how much we gain then.
If there is something I should use or do (VisualVM?), just
tell me to do so. I'm interested as well about the gains.</span></div>
<div class="ms-outlook-mobile-reference-message skipProofing"
style="font-family: verdana; font-size: 12px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);"> </span></div>
<div class="ms-outlook-mobile-reference-message skipProofing"
style="font-family: verdana; font-size: 12px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);">Marius</span></div>
<div class="ms-outlook-mobile-reference-message skipProofing"
style="font-family: verdana; font-size: 12px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);"> </span></div>
<div class="ms-outlook-mobile-reference-message skipProofing"
style="font-family: verdana; font-size: 12px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);"> </span></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><b>Gesendet: </b>Dienstag, 24. Februar 2026 um 08:05</div>
<div><b>Von: </b>"John Hendrikx"
<a class="moz-txt-link-rfc2396E" href="mailto:john.hendrikx@gmail.com"><john.hendrikx@gmail.com></a></div>
<div><b>An: </b>"Andy Goryachev"
<a class="moz-txt-link-rfc2396E" href="mailto:andy.goryachev@oracle.com"><andy.goryachev@oracle.com></a>,
<a class="moz-txt-link-rfc2396E" href="mailto:openjfx-dev@openjdk.org">"openjfx-dev@openjdk.org"</a> <a class="moz-txt-link-rfc2396E" href="mailto:openjfx-dev@openjdk.org"><openjfx-dev@openjdk.org></a></div>
<div><b>Betreff: </b>[External] : Re: Experiment: Node
properties</div>
</div>
<p>Thanks for the taking the time to respond.</p>
<div class="moz-cite-prefix">On 24/02/2026 00:32, Andy
Goryachev wrote:</div>
<blockquote>
<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);">
</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>
</blockquote>
<p>What is more cache friendly about adding several extra
indirections to get to a property's value? Let me see:</p>
<p>Before:</p>
<p>- isFocusTraversable(): get property -> get value</p>
<p>After:</p>
<p>- isFocusTraversable(): get fast map -> get key
ArrayList -> get internal array -> get value ArrayList
-> get internal array -> get property -> get value</p>
<p>For the garbage collector, the properties are likely going
to be in an area of the GC collector that will be scanned
rarely, and not part of the frequent scans for young
objects. I don't think we can generally conclude that having
less memory used will have an overall positive impact on the
GC here. The properties will be seen as long-lived by the
GC, and will reside in an area only scanned rarely, which
has very little impact on the performance of most GC
implementations. </p>
<blockquote>
<div
style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</div>
<div
style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</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);">
</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>
</blockquote>
<p>That's anecdotal, and will depend on the type of
application, platform, CPU cores available, etc. So while
you may be correct for your trading application, it may be
completely the opposite for a task tracking application. In
general, memory use is hardly a factor for most
applications; most Java apps don't even bother to limit the
heap, yet complain about several GB's of memory use when
they have a retained size of less than half a GB. Not that
I'm not in favor of reducing memory footprint, but I
seriously wonder if there is much to gain at the property
level.</p>
<p> </p>
<blockquote>
<div
style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</div>
<div
style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</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);">
</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://urldefense.com/v3/__https://github.com/andy-goryachev-oracle/Test/blob/main/doc/Experiments/NodeProperties.md__;!!ACWV5N9M2RV99hQ!Ie39KHLQqoER4VeWP4KDgwa3XMIaPBzgSg5sb8HylkbYhnc-m6ZCEp47-JW4rGw_H6HC8QAiqE2XdTmaWPoLWy23$"
target="_blank" class="moz-txt-link-freetext"
rel="noopener noreferrer"
data-outlook-id="a3f38d39-611c-4268-8d52-e3541708f080"
moz-do-not-send="true">
https://github.com/andy-goryachev-oracle/Test/blob/main/doc/Experiments/NodeProperties.md</a> ,
please take a look.</div>
</blockquote>
I took a look, but could only find statistics about
properties. I didn't see a breakdown of general JavaFX memory
use (the other 95%) to see if properties are the lowest
hanging fruit.<br>
<blockquote>
<div
style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</div>
<div
style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</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" target="_blank"
class="moz-txt-link-freetext"
rel="noopener noreferrer"
data-outlook-id="e2ab6549-b8ea-4618-a12e-0f0c053d3d2d"
style="margin-top: 0px; margin-bottom: 0px;"
moz-do-not-send="true">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);">
</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>
</blockquote>
<p>Compact Object Headers is especially relevant here as
you're optimizing small objects (properties) on which JEP519
offers the most relative gain. Enabling it may reduce the
5% memory gain you measured to a smaller margin, which
impacts the rationale for this change.</p>
<p>Furthermore, if we're talking about saving memory, I think
we can assume we're using small heaps (less than 32 GB). In
that case, Hotspot will use 4 bytes per pointer (compressed
OOPs) not 8, so your assumption of 8 bytes per pointer will
be incorrect in the vast majority of JavaFX cases.</p>
<blockquote>
<div
style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</div>
<div
style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</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);">
</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>
</blockquote>
<p>I'm aware of the intentions to only put the rarely used
properties there. What is rarely used will depend on the
application. How many properties will end up being stored
there also depends on the application. What if the app does
need several of these properties and this structure grows to
contain 20-30 properties?</p>
<p>Currently your proposal wants to store these rarely used
properties in an O(n) structure, whereas a hash based
solutions are O(1), and where doing nothing is even faster
as there is no map at all.</p>
<p>So although your map implementation may be small and cache
friendly (that last point being debatable, see indirection
count), it degrades badly when there are more than the
predicted amount of properties, and requires many more
indirections than the base case of doing nothing.</p>
<p>There is talk about not having to do an expensive
`hashCode` call in your proposal. First, `hashCode` is
really cheap for objects not implementing equality as it
falls back on the Object#hashCode. I believe this is the
case for properties. Even if it isn't the case, you could
use the identity hash code here (the `==` equivalent in the
hashing world).</p>
<p>However that "expensive" call is what enables the O(1)
lookup of the value you are interested in, which can be
truly cache friendly with the right structure (array based
open addressed map).</p>
<p>--John</p>
<blockquote>
<div
style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</div>
<div
style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</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);">
</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);">
</div>
<div
style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</div>
<div
style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</div>
<div
style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</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; font-family: Aptos; font-size: 12pt; color: black;">
<b>From: </b>openjfx-dev <a
href="mailto:openjfx-dev-retn@openjdk.org"
target="_blank" class="moz-txt-link-rfc2396E"
rel="noopener noreferrer"
data-outlook-id="8285433a-dc21-4193-b293-445517b9b795"
moz-do-not-send="true">
<openjfx-dev-retn@openjdk.org></a> on behalf of
John Hendrikx <a href="mailto:john.hendrikx@gmail.com"
target="_blank" class="moz-txt-link-rfc2396E"
rel="noopener noreferrer"
data-outlook-id="b864ae1c-dc58-4105-bf5d-8b23fa1de11c"
moz-do-not-send="true">
<john.hendrikx@gmail.com></a><br>
<b>Date: </b>Thursday, February 19, 2026 at 15:28<br>
<b>To: </b><a href="mailto:openjfx-dev@openjdk.org"
target="_blank"
class="moz-txt-link-abbreviated moz-txt-link-freetext"
rel="noopener noreferrer"
data-outlook-id="845e0c66-ba74-450e-9071-5391e432bcb9"
moz-do-not-send="true">openjfx-dev@openjdk.org</a>
<a href="mailto:openjfx-dev@openjdk.org" target="_blank"
class="moz-txt-link-rfc2396E"
rel="noopener noreferrer"
data-outlook-id="3df3c59d-d40f-486a-b265-145d7d894d5c"
moz-do-not-send="true">
<openjfx-dev@openjdk.org></a><br>
<b>Subject: </b>Re: Experiment: Node properties<br>
<br>
</div>
<p
class="ms-outlook-mobile-reference-message skipProofing"> </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);">
</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" target="_blank"
class="moz-txt-link-freetext"
rel="noopener noreferrer"
data-outlook-id="e0a8ca20-b5c3-4715-9e02-6f26b4e571eb"
style="margin-top: 0px; margin-bottom: 0px;"
moz-do-not-send="true">https://openjdk.org/jeps/519</a>]</p>
<p
class="ms-outlook-mobile-reference-message skipProofing"> </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);">
</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);">
</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);">
</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);">
</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);">
</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://urldefense.com/v3/__https://github.com/andy-goryachev-oracle/Test/blob/main/doc/Experiments/NodeProperties.md__;!!ACWV5N9M2RV99hQ!Ie39KHLQqoER4VeWP4KDgwa3XMIaPBzgSg5sb8HylkbYhnc-m6ZCEp47-JW4rGw_H6HC8QAiqE2XdTmaWPoLWy23$"
target="_blank" class="moz-txt-link-freetext"
rel="noopener noreferrer"
data-outlook-id="497837bb-ac53-480c-8ae4-43db1414979f"
moz-do-not-send="true">
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;">
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</blockquote>
</body>
</html>