-
Notifications
You must be signed in to change notification settings - Fork 916
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
Improve the perceived performance of Discover #6599
Improve the perceived performance of Discover #6599
Conversation
❌ Invalid Prefix For Manual Changeset CreationInvalid description prefix. Found "feat". Only "skip" entry option is permitted for manual commit of changeset files. If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description. |
❌ Invalid Prefix For Manual Changeset CreationInvalid description prefix. Found "feat". Only "skip" entry option is permitted for manual commit of changeset files. If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6599 +/- ##
===========================================
+ Coverage 32.93% 67.72% +34.79%
===========================================
Files 2260 3401 +1141
Lines 45769 66574 +20805
Branches 7200 10819 +3619
===========================================
+ Hits 15075 45089 +30014
+ Misses 29984 18850 -11134
- Partials 710 2635 +1925
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
903eb14
to
2e2ddde
Compare
src/plugins/discover/public/application/components/data_grid/data_grid.tsx
Show resolved
Hide resolved
src/plugins/discover/public/application/components/data_grid/data_grid.tsx
Show resolved
Hide resolved
src/plugins/discover/public/application/components/data_grid/data_grid.tsx
Show resolved
Hide resolved
@AMoo-Miki Can you add the changeset file? |
Signed-off-by: Miki <[email protected]>
2e2ddde
to
82dd4c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I havent reviewed the data grid component because you plan on deprecating it anyways and is apparently the exact same code for now. The rest LGTM.
src/plugins/discover/public/application/components/data_grid/data_grid_table.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free not to block on my comments
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import './_data_grid_table.scss'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the css get imported twice or is it deduplicated? (not sure if the dedupe option is turned on for the loader)
Given this will be removed, feel free to ignore if this ends up having no real impact.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. The other one needs to go. Will add it to s subsequent PR.
const displayedColumns = getLegacyDisplayedColumns( | ||
columns, | ||
indexPattern, | ||
hideTimeColumn, | ||
isShortDots | ||
); | ||
const displayedColumnNames = displayedColumns.map((column) => column.name); | ||
const pageSize = 50; | ||
const [renderedRowCount, setRenderedRowCount] = useState(50); // Start with 50 rows | ||
const pageSize = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this an intended change in pageSize from previous behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Being infinite-scrolled, 10 is nice balance between performance and initial view. In a future iteration, we will add lazy loading of the subsequent rows to make it even more unnoticeable.
// Current data grid loads 100 rows per page by default with inspect button and time range | ||
await dashboardExpect.savedSearchRowCountFromLegacyTable(100); | ||
// DefaultDiscoverTable loads 10 rows initially | ||
await dashboardExpect.rowCountFromDefaultDiscoverTable(10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: does it makes sense to export pageSize as a constant and use that here to avoid future updates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does. I will add that.
On second thought, when lazy-loading is added, depending on when the test attempts to count, we could have pageSize
or greater than that. I will make this test act accordingly, using an exported value, to be future-safe.
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-6599-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b2c4b9c1b6128c2a0a20a54bd1865c47e4e0705a
# Push it to GitHub
git push --set-upstream origin backport/backport-6599-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x Then, create a pull request where the |
One question regarding perf metrics: are those tracked somewhere? Just curious if there's a way of validating the expected gains hold in production builds. |
@AMoo-Miki FYI, the auto backport failed, you may need to do it manually. |
@ruanyl yes that is something that we need. |
No but I intend to add code coverage and performance metrics gathering to my test framework.
The graphs I placed above were from prod builds. |
Signed-off-by: Miki <[email protected]> (cherry picked from commit b2c4b9c) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
(cherry picked from commit b2c4b9c) Signed-off-by: Miki <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: Miki <[email protected]>
Description
Removed the simultaneous rendering of
DefaultDiscoverTable
andDataGrid
when only one would be displayed.Bumped DOMPurify for a boost in performance.
Issues Resolved
Screenshot
2.13 - 10s span
PR - 10s span
Changelog
Check List
yarn test:jest
yarn test:jest_integration