-
Notifications
You must be signed in to change notification settings - Fork 534
8359599: Calling refresh() for all virtualized controls recreates all cells instead of refreshing the cells #1830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…stead of refreshing the cells
👋 Welcome back mhanl! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
This is a risky change and will need to be carefully tested. Reviewers: @andy-goryachev-oracle @johanvos /reviewers 2 reviewers |
@kevinrushforth |
It is indeed true that refresh() is often a very expensive operation. Whenever Hence, while I like the idea here (avoiding unneeded heavy-cost operations in VirtualFlow), I would like to avoid a number of follow-up issues once this is merged -- driven by a change in "expected" behavior. |
I completely agree. We need to be careful with such changes.
Since all rows (and cells) are reset and then updated, all changes that were not taken into account by the control are taken into account in any case then. But I think there is one concrete case which breaks now. Example
Here, I'm aware that But that is still a valid risk that we need to consider. This is the only problem I see right now. |
@Maran23 This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a |
My main concern with this PR is that we might get a minute performance improvement, while risking regression. Would it be possible to get some measurements using a modern system? What do you think? |
I think the performance improvements due to this PR can be pretty significant. The problem is indeed the risk on regression. I believe we need improvements in 2 areas before we can safely merge this:
|
I think a CSR is needed if we're changing the documentation. It specifically says it recreates the cells (although the purpose of that eludes me, aside from badly written cells). Since cells are supposed to be updated, and not "retain" anything from previous contents, I think only only buggy cells would benefit from recreating. Such buggy cells however would probably have subtle problems already when they're never recreated, like listener leaks. So although I agree that recreating is not needed as cell functionality is defined by their |
I agree. /csr needed |
@kevinrushforth has indicated that a compatibility and specification (CSR) request is needed for this pull request. @Maran23 please create a CSR request for issue JDK-8359599 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
@Maran23 This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a |
When calling
refresh()
on virtualized Controls (ListView
,TreeView
,TableView
,TreeTableView
), all cells will be recreated completely, instead of just refreshing them.This is because
recreateCells()
of theVirtualFlow
is called whenrefresh()
was called. This is not needed, since refreshing the cells can be done much cheaper withrebuildCells()
.This will reset all cells (
index = -1
), add them to the pile and fill them back in the viewport with an index again. This ensuresupdateItem()
is called.The contract of
refresh()
is also a big vague, stating:As written above, recreating is not needed in order to fulfull the contract of updating what is shown to the user in case the underlying data source changed without JavaFX noticing (e.g. calling a normal Setter without any Property and therefore listener involved).
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1830/head:pull/1830
$ git checkout pull/1830
Update a local copy of the PR:
$ git checkout pull/1830
$ git pull https://git.openjdk.org/jfx.git pull/1830/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1830
View PR using the GUI difftool:
$ git pr show -t 1830
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1830.diff
Using Webrev
Link to Webrev Comment