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
LazyDataModel: no need to count if first == 0 and lazyData.size < pageSize #11506
Open
Comments
@cocorossello were you going to submit a PR for review? |
I can try it, I just wanted to know your opinion before |
Try a PR it will run all our integration tests... |
melloware
added
⚡ performance
Performance related issue or enhancement
and removed
‼️ needs-triage
Issue needs triaging
new feature
labels
Feb 22, 2024
@cocorossello PR coming? |
cocorossello
pushed a commit
to Travelcompositor/primefaces
that referenced
this issue
Feb 23, 2024
…&& lazyData.size < pageSize
cocorossello
pushed a commit
to Travelcompositor/primefaces
that referenced
this issue
Feb 23, 2024
…&& lazyData.size < pageSize
Rapster
added a commit
that referenced
this issue
May 1, 2024
… lazyDat…" This reverts commit 5b40141.
Rapster
added a commit
that referenced
this issue
May 1, 2024
@cocorossello can you resubmit your PR so we can investigate why its failing in 15.0.0? |
cocorossello
pushed a commit
to Travelcompositor/primefaces
that referenced
this issue
May 4, 2024
…zyData.size < pageSize
cocorossello
pushed a commit
to Travelcompositor/primefaces
that referenced
this issue
May 5, 2024
cocorossello
pushed a commit
to Travelcompositor/primefaces
that referenced
this issue
May 5, 2024
cocorossello
pushed a commit
to Travelcompositor/primefaces
that referenced
this issue
May 6, 2024
cocorossello
pushed a commit
to Travelcompositor/primefaces
that referenced
this issue
May 6, 2024
cocorossello
pushed a commit
to Travelcompositor/primefaces
that referenced
this issue
May 6, 2024
…uted yet" This reverts commit a96b252.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Regarding DataView with lazy=true:
If first == 0 there is no need to count at the beginning and we can skip the calculateFirst method.
After the load, if the size of the loaded data is less than the pageSize, there is no need to count.
This is the case for DataView, but I believe its the same case for DataTable, DataList and DataGrid.
Count can be an expensive operation with LazyDataModel, especially when no filters are applied (first load).
It can be achieved playing with the count attribute, but it's awkward and it sometimes breaks on upgrades.
WDYT?
Describe the solution you would like
If first == 0 and loaded data size < pageSize no count() operation should be performed on the lazyDataModel
Additional context
No response
The text was updated successfully, but these errors were encountered: