<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 04/02/2026 22:17, Andy Goryachev
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CY8PR10MB72651B8D00F2F0D9A7A35AB5E598A@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);">
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: 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 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>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>Are the resource constrained platforms you named generally memory
or CPU constrained?</p>
<p>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>Would the gains you made here become irrelevant or less relevant
with Compact Object Headers [<a class="moz-txt-link-freetext" href="https://openjdk.org/jeps/519">https://openjdk.org/jeps/519</a>]<br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:CY8PR10MB72651B8D00F2F0D9A7A35AB5E598A@CY8PR10MB7265.namprd10.prod.outlook.com">
<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 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>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.<br>
</p>
<p>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>--John<br>
</p>
<blockquote type="cite"
cite="mid:CY8PR10MB72651B8D00F2F0D9A7A35AB5E598A@CY8PR10MB7265.namprd10.prod.outlook.com">
<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);">
Cheers,</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);">
<b>References</b></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);">
[0] <a
href="https://github.com/andy-goryachev-oracle/Test/blob/main/doc/Experiments/NodeProperties.md"
data-outlook-id="217ca979-74ae-4107-9a0b-bf3cf23cb5ec"
moz-do-not-send="true" class="moz-txt-link-freetext">
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: 12pt;">
<br>
</div>
</blockquote>
</body>
</html>