<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>There is actually a ticket for the problem that the table slows down more and more when scrolling to the bottom:</div>

<div>
<div>https://bugs.openjdk.org/browse/JDK-8293836</div>

<div>This also happens when setting the fixed cell size, so there is 100% a bug somewhere down there.</div>

<div> </div>

<div>-- Marius</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> Dienstag, 22. November 2022 um 10:58 Uhr<br/>
<b>Von:</b> "John Hendrikx" <john.hendrikx@gmail.com><br/>
<b>An:</b> openjfx-dev@openjdk.org<br/>
<b>Betreff:</b> Re: List scrolling is very slow in JavaFX 17</div>

<div name="quoted-content">
<p>I took a quick look, I didn't see any Node creation, the updateItem calls look pretty normal (setting some labels and a list of tags).</p>

<p>I downloaded the application and installed the application (it's nicely packaged) and clicked on "download" which shows the problematic list.  It indeed performs badly (10 fps orso), even when showing only about 100 items (of which 6 were visible at a time).  All items are the same height.  When turning on another option (snapshots) there are probably 1000 items or more, still showing at most 6 at a time and FPS drops to like 2 or 3; I'd consider it pretty unusable.  It doesn't seem to improve after a while either.</p>

<p>I don't like the fact that it seems to get slower with more items in the list, but still only 6 showing at a time.</p>

<p>Is there a description somewhere of how the current implementation works?   Is it trying to get the sizes of all cells (eventually) to make an accurate scroll bar representation?  I don't quite see how that could possibly work without querying all cells, as a single cell could be large enough to influence the scroll bar size and position significantly even among thousands of items...</p>

<p>Thinking further, once a list passes a certain size, the scrollbar thumb will be at its minimum size, there is little point to try to get the exact relative sizes of position and knob then that may require information on all cells. Does the implementation have an option to switch to a more simplistic scrollbar representation (1 cell = 1 position, regardless of size) when the number of visible cells are vastly outnumbered by the total number of items?</p>

<p>The fixedCellSize property probably will alleviate the performance problems, but I find it hard to use as generally I only know that my cells are all the same size, but I don't know what that size actually is as it depends on the styles used.</p>

<p>--John</p>

<div class="moz-cite-prefix">On 22/11/2022 09:48, Johan Vos wrote:</div>

<blockquote>
<div>Hi Glavo,
<div> </div>

<div>There are more frequent calls to updateItem() since the VirtualFlow tries to gradually improve its estimation how large the total list size is (rather than assuming all cells have the same size). The major point is that if you override updateItem, it should not do more than strictly needed (e.g. don't create a Node etc). That method should return as fast as possible.</div>

<div> </div>

<div>There are many completely different usecases for VirtualFlow in general, and it's not trivial to come up with a single implementation that deals "best" with all usecases. Therefore, I recently solicited for feedback and it might be good if you can give yours too? </div>

<div>See <a class="moz-txt-link-freetext" href="https://mail.openjdk.org/pipermail/openjfx-dev/2022-September/035851.html" target="_blank">https://mail.openjdk.org/pipermail/openjfx-dev/2022-September/035851.html</a> for the start of the discussion.</div>

<div> </div>

<div>- Johan</div>

<div> </div>
</div>
 

<div class="gmail_quote">
<div class="gmail_attr">On Tue, Nov 22, 2022 at 9:24 AM Glavo <<a class="moz-txt-link-freetext" href="mailto:zjx001202@gmail.com" onclick="parent.window.location.href='mailto:zjx001202@gmail.com'; return false;" target="_blank">zjx001202@gmail.com</a>> wrote:</div>

<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>Hi, 
<div> </div>

<div>I'm one of the maintainers of the open source project HMCL (Hello! Minecraft Launcher<i>)</i>. This is a Minecraft launcher based on JavaFX. 

<div>
<div> </div>

<div>In the past year, we have received a lot of feedback on performance problems. Through performance analysis, I noticed that from JavaFX 17 ea+8, the performance of list scrolling is terrible.</div>

<div> </div>

<div>I analyzed the method calls and noticed that the updateItem method of ListCell is called 8 times more frequently in JavaFX 17 than in JavaFX 16.</div>

<div> </div>

<div>I guess this is due to the following commit:</div>

<div> </div>

<div>    <a class="moz-txt-link-freetext" href="https://github.com/openjdk/jfx/commit/8e547571fb3d40df843c27fc11921b5d4765c481" target="_blank">https://github.com/openjdk/jfx/commit/8e547571fb3d40df843c27fc11921b5d4765c481</a></div>

<div> </div>

<div>I wonder if this is a bug? </div>
</div>

<div> </div>

<div>Best regards,<br/>
Glavo</div>

<div> </div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</div></div></body></html>