Skip to content
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

[Feature request] Merge node operations to avoid unnecessary UIManager calls #199

Closed
boxizen opened this issue Mar 28, 2020 · 1 comment · Fixed by #200
Closed

[Feature request] Merge node operations to avoid unnecessary UIManager calls #199

boxizen opened this issue Mar 28, 2020 · 1 comment · Fixed by #200
Assignees

Comments

@boxizen
Copy link
Contributor

boxizen commented Mar 28, 2020

Is your feature request related to a problem? Please describe.
When a component is inserted into the page, especially in the case of ListView, the renderer will have multiple calls of insertChild, which creates additional overhead and may have a negative impact on FPS.

Describe the solution you'd like
Merge multiple consecutive createNode operations while keeping the order of createNode updateNode and deleteNode unchanged.

Describe alternatives you've considered
When triggering node operations, first push the nodes which will be updated into the array, then separate and integrate the nodes in the microtask stage. Finally, perform a batch insert operation on the integrated node array

Additional context
image

In the case of sliding ListView (Statistics from perfdog):

FPS Before Merged
Avg 48.8 52.15
Max 57.9 58.9
@boxizen boxizen changed the title [Feature request] Merge node operations to avoid unnecessary bridge calls [Feature request] Merge node operations to avoid unnecessary UIManager calls Mar 29, 2020
@xuqingkuang
Copy link
Contributor

Thank you for your patch.

But could you have an investigation for the optimization patch? Why merge the insertChild will makes the fps higher?

The points:

  1. There is a similar queue like __batchNodes in the native, the UIManagerModule operations will append actions into the queue, then flush when endBatch executed. In fact, hippy-react should submit the UI operations as soon.
  2. The fps should be affected by the native, not hippy-react.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants