TreeGrid loads all data from the data provider when scroll position changes
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
For fetching hierarchical data (for TreeGrid) the HierarchyMapper is used. Method
public Stream<T> fetchItems(Range range)
is invoked every time the current scroll position of the Tree(Grid) changes. What happens is that the hierarchy is retrieved, and then in memory stream operations are done to skip to and limit the correct amount of data shown like this:
return getHierarchy(null).skip(range.getStart()).limit(range.length());
This will effectively for every scroll position change load ALL data from the backing data provider. Needless to say this will slow down any lazy loading intended hierarchical grids to crawl if there's more than trivial amount of data.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with HierarchyMapper.fetchItems(Range range) and trace its getHierarchy(null) call. Reproduce scrolling with a lazy-loading hierarchical data provider and inspect whether the full hierarchy is loaded before skip and limit. Done means range fetching no longer loads all backing data on each scroll position change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100