-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Lens] Drag and drop performance improvements #91641
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
Conversation
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
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.
this change is only removing ChildDragDropProvider and removing dragDropContext from buttons' props.
87ae2ba to
0be797c
Compare
…el. Only pass dragging to getDropProps
658f37d to
e9a7736
Compare
… don't have a flickering dragover-dragend
...ns/lens/public/editor_frame_service/editor_frame/config_panel/draggable_dimension_button.tsx
Outdated
Show resolved
Hide resolved
|
Tested on Chrome and profiled it. There's a good perf boost from I'm a bit unsure whether all the memoization in |
f34db6f to
673019b
Compare
|
Hey @dej611! Thank you for checking my PR! About the memoizations in the workspace_panel component, you’re right – I firstly made it this way because it made sense, and then I switched to moving context in upper component, so it doesn’t matter that much – I don’t have a strong opinion about leaving it or moving it there so I'll just remove it, please take a look again. |
MichaelMarcialis
left a comment
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.
LGTM
|
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
…ndition-for-hiding-recommded-allocation * 'master' of github.com:elastic/kibana: (117 commits) [coverage] ingest data in parallel (elastic#92074) [Lens] Drag and drop performance improvements (elastic#91641) A few more environment uiFilters fixes (elastic#92044) Enabling Uptime and Dashboard a11y test (elastic#91017) [Security Solution][Detections] Adds more granular validation for nested fields (elastic#92041) [Security Solution] [Detections] add overflow-wrap for description (elastic#91945) [Security Solution] [Detections] do not truncate filename in value list table in modal (elastic#91952) Skip flaky apm test elastic#91673 (elastic#92065) [docker] Default server.name to hostname (elastic#90799) Use documentation link service for snapshot restore (elastic#91596) [Security Solution] Clearing up all jest errors and warnings (elastic#91740) Add `@kbn/analytics` to UI Shared Deps (elastic#91810) [7.12][Telemetry] Add missing fields for security telemetry (elastic#91920) [Security Solution] Adds cypress-pipe (elastic#91550) [ML] Fix event rate chart annotation position (elastic#91899) [APM] Break down error table api removing the sparklines (elastic#89138) docs: update dependencies table bug (elastic#91964) [Time to Visualize] Stay in Edit Mode After Dashboard Quicksave (elastic#91729) Unskip Search Sessions Management UI test (elastic#90110) [Fleet] Handle long text in agent details page (elastic#91776) ... # Conflicts: # x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.helpers.tsx # x-pack/plugins/index_lifecycle_management/__jest__/components/edit_policy.test.tsx
…bana into task-manager/docs-monitoring * 'task-manager/docs-monitoring' of github.com:gmmorris/kibana: (29 commits) Update docs/developer/plugin-list.asciidoc Update docs/api/task-manager/health.asciidoc Update docs/api/task-manager/health.asciidoc [Lens] Load indexpatterns list from indexPattern Service (elastic#91984) [coverage] ingest data in parallel (elastic#92074) [Lens] Drag and drop performance improvements (elastic#91641) A few more environment uiFilters fixes (elastic#92044) Enabling Uptime and Dashboard a11y test (elastic#91017) [Security Solution][Detections] Adds more granular validation for nested fields (elastic#92041) [Security Solution] [Detections] add overflow-wrap for description (elastic#91945) [Security Solution] [Detections] do not truncate filename in value list table in modal (elastic#91952) Skip flaky apm test elastic#91673 (elastic#92065) [docker] Default server.name to hostname (elastic#90799) Use documentation link service for snapshot restore (elastic#91596) [Security Solution] Clearing up all jest errors and warnings (elastic#91740) Add `@kbn/analytics` to UI Shared Deps (elastic#91810) [7.12][Telemetry] Add missing fields for security telemetry (elastic#91920) [Security Solution] Adds cypress-pipe (elastic#91550) [ML] Fix event rate chart annotation position (elastic#91899) [APM] Break down error table api removing the sparklines (elastic#89138) ...
* master: (36 commits) [Uptime] Thumbnail full screen view steps navigation fix (elastic#91895) Implement ScopedHistory.block (elastic#91099) [Lens] Fix overlowing content on a chart for charts and table (elastic#92006) handle source column differences in embeddable as well (elastic#91987) [Vega] [Map] disable map rotation using right right click / touch rotation gesture (elastic#91996) [Lens] Load indexpatterns list from indexPattern Service (elastic#91984) [coverage] ingest data in parallel (elastic#92074) [Lens] Drag and drop performance improvements (elastic#91641) A few more environment uiFilters fixes (elastic#92044) Enabling Uptime and Dashboard a11y test (elastic#91017) [Security Solution][Detections] Adds more granular validation for nested fields (elastic#92041) [Security Solution] [Detections] add overflow-wrap for description (elastic#91945) [Security Solution] [Detections] do not truncate filename in value list table in modal (elastic#91952) Skip flaky apm test elastic#91673 (elastic#92065) [docker] Default server.name to hostname (elastic#90799) Use documentation link service for snapshot restore (elastic#91596) [Security Solution] Clearing up all jest errors and warnings (elastic#91740) Add `@kbn/analytics` to UI Shared Deps (elastic#91810) [7.12][Telemetry] Add missing fields for security telemetry (elastic#91920) [Security Solution] Adds cypress-pipe (elastic#91550) ...
Summary
Involves performance changes:
getDropPropsand don't pass it at all toonDrop(we didn't use it at all)suggestionForDraggedFieldas this function is quite expensive (2~8ms) and was being executed twice on changing the context when dragging startedactiveDropTargetconsisted ofactiveDropTargetanddropTargetsByOrderso everytime we registered dropTargetsByOrder all the elements rerendered. NowactiveDropTargetanddropTargetsByOrderare two separate props of a context.before:


after:
Results
Before:

After:

Example improvement in editor frame: When starting a drag, we have two rerenders - when
draggingchanges in context, and then when all the dropTargetsByOrder register. The second rerender improved a lot, the first not so much as thedraggingprops has to be passed down to many components.before when starting a drag, illustrated 2 rerenders :

after:

The message below disappeared when starting mouse dragging:

When throttling my processor x 4 times slower, the message still appears but times dropped by more than a half and don't appear for dragend at all:
before (repeatedly starting a drag and dropping in empty area):

after:

I have some ideas to further improve performance, but I don't want to do this ahead of time as big changes are awaiting so I'll leave it as it is.