<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>If you look closely, I removed:</div>

<div> </div>

<div>
<div>tableSkin.getChildren().remove(cell);</div>

<div> </div>

<div>So the cell was previously removed, but it was never added to the table skin in the first place.</div>

<div>The cell is added to the row instead.</div>

<div> </div>

<div>Thats why the line below does remove the table row instead:</div>

<div> </div>

<div>tableSkin.getChildren().remove(tableRow);</div>

<div> </div>

<div>So your code is faster because it will remove the table row in the first loop iteration and never add it again, so the call to applyCss() is faster (basically a noop as the row is not inside the scenegraph).</div>

<div> </div>

<div>-- Marius</div>

<div> </div>

<div> 
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Freitag, 02. Februar 2024 um 10:49 Uhr<br/>
<b>Von:</b> "Robert Lichtenberger" <r.lichtenberger@gmail.com><br/>
<b>An:</b> openjfx-dev@openjdk.org<br/>
<b>Betreff:</b> Re: CSS Performance regression inTableColumnHeader.resizeColumnToFitContent</div>

<div name="quoted-content"><br/>
Am 02.02.24 um 07:10 schrieb Robert Lichtenberger:<br/>
><br/>
>><br/>
>> However, if you want to narrow it down further (perhaps there is more<br/>
>> performance to be gained), you could run your tests against the early<br/>
>> access builds.  You may be able to find a set of 10-20 isolated<br/>
>> commits that could have led to the introduction of the extra 60.000<br/>
>> calls.  For example, check if the problem is present in 20-ea+1 up to<br/>
>> 20-ea-19, 20, 20.0.1 and 20.0.2 (early access versions available are<br/>
>> 1, 2, 3, 4, 6, 7, 9, 11, 19), see here:<br/>
>> <a href="https://mvnrepository.com/artifact/org.openjfx/javafx-base" target="_blank">https://mvnrepository.com/artifact/org.openjfx/javafx-base</a><br/>
><br/>
> Good idea, I will try that.<br/>
<br/>
Okay, using prebuilt ea-Versions I was able to narrow the problem down:<br/>
<br/>
JFX 19.0.2+1 average run time: 1113<br/>
JFX 20-ea+1 average run time: 1110<br/>
JFX 20-ea+7 average run time: 1211<br/>
JFX 20-ea+9 average run time: 1115<br/>
JFX 20-ea+11 average run time: 1646<br/>
JFX 20.0.2+3 average run time: 1656<br/>
<br/>
=> Something has happened between ea+9 and ea+11.<br/>
<br/>
I've then let the benchmark run against self-built sdks that are based<br/>
on the git tags.<br/>
<br/>
git checkout tags/20+9: JFX 20-internal+0-2024-02-02-095926 average run<br/>
time: 1098<br/>
<br/>
git checkout tags/20+11: JFX 20-internal+0-2024-02-02-095926 average run<br/>
time: 1576<br/>
<br/>
So this confirms the data of the prebuilt sdks.<br/>
<br/>
<br/>
There's also a 20+10 tag, which is still fast: JFX<br/>
20-internal+0-2024-02-02-095926 average run time: 1078<br/>
<br/>
<br/>
So now I've looked at the commits betweeen 20+10 and 20+11.<br/>
<br/>
git checkout c2af0c31b70df238769bd0eb1b7fd04eb7241446: JFX<br/>
20-internal+0-2024-02-02-095926 average run time: 1093<br/>
<br/>
git checkout bb98d886b01d5d1c6117303f40d43eab9f7ac504: JFX<br/>
20-internal+0-2024-02-02-095926 average run time: 1072<br/>
=> So it wasn't the "8295806: TableViewSkin: memory leak when changing<br/>
skin" commit<br/>
<br/>
git checkout 6abbe0803456ad648117b8e72deeeeced7cb5231: JFX<br/>
20-internal+0-2024-02-02-095926 average run time: 1086<br/>
<br/>
git checkout c900a00c7527f290e8047792fef4b45002930892: JFX<br/>
20-internal+0-2024-02-02-095926 average run time: 1608<br/>
<br/>
=> So the "culprit" seems to be the "8289357: (Tree)TableView is null in<br/>
(Tree)TableRowSkin during autosize" commit by Marius Hanl.<br/>
<br/>
<br/>
Looking into the commit, I see that the<br/>
"tableSkin.getChildren().remove(tableRow);" hast been moved out of the<br/>
for-loop.<br/>
<br/>
I've put it back into the loop, which should make things slower, but:<br/>
JFX 20-internal+0-2024-02-02-095926 average run time: 161<br/>
<br/>
Looks like things are _ten times_ faster this way.<br/>
<br/>
Tests in javafx.controls still pass.<br/>
<br/>
Sounds almost too good to be true, so I will investigate a bit further...<br/>
<br/>
<br/>
Robert<br/>
<br/>
 </div>
</div>
</div>
</div></div></body></html>