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

optimize the performance #442

Merged
merged 30 commits into from
Sep 11, 2023

Conversation

LucasXu0
Copy link
Collaborator

@LucasXu0 LucasXu0 commented Sep 6, 2023

Rendering Optimization

  • Support rendering only the on-screen block components.
  • Support rendering the selection area or the cursor within the block components, making the selection behavior more customizable.
  • Reduce unnecessary builds for the selection area.

Calculation Optimization

  • Cache the children of the node to prevent multiple calculations.
  • Optimize the selection calculation to only involve the visible block components.

@codecov
Copy link

codecov bot commented Sep 7, 2023

Codecov Report

Patch coverage: 76.87% and project coverage change: +0.65% 🎉

Comparison is base (ad55171) 79.87% compared to head (b2d0865) 80.52%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #442      +/-   ##
==========================================
+ Coverage   79.87%   80.52%   +0.65%     
==========================================
  Files         276      280       +4     
  Lines       11526    11302     -224     
==========================================
- Hits         9206     9101     -105     
+ Misses       2320     2201     -119     
Files Changed Coverage Δ
...nent/service/renderer/block_component_context.dart 100.00% <ø> (ø)
...omponent/service/scroll/mobile_scroll_service.dart 0.00% <0.00%> (-78.38%) ⬇️
...or/editor_component/service/selection_service.dart 100.00% <ø> (ø)
lib/src/render/selection/selection_widget.dart 0.00% <ø> (-100.00%) ⬇️
...uts/command_shortcut_events/backspace_command.dart 84.90% <27.27%> (-15.10%) ⬇️
...rtcuts/command_shortcut_events/delete_command.dart 76.19% <27.27%> (-17.56%) ⬇️
...se_component/selection/selection_area_painter.dart 28.57% <28.57%> (ø)
...t/image_block_component/image_block_component.dart 57.73% <50.00%> (+1.41%) ⬆️
...component/service/ime/non_delta_input_service.dart 83.72% <50.00%> (-0.54%) ⬇️
...vider_block_component/divider_block_component.dart 63.63% <66.66%> (+0.73%) ⬆️
... and 35 more

... and 7 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@LucasXu0 LucasXu0 force-pushed the optimize_with_list_builder branch from 7f8ce28 to 5063495 Compare September 7, 2023 05:49
@LucasXu0 LucasXu0 added the improvements improvements on an existing feature label Sep 7, 2023
@LucasXu0 LucasXu0 force-pushed the optimize_with_list_builder branch 2 times, most recently from 1e685f3 to 276ef7c Compare September 11, 2023 06:17
@LucasXu0 LucasXu0 force-pushed the optimize_with_list_builder branch from 276ef7c to 1dfb627 Compare September 11, 2023 06:18
@LucasXu0 LucasXu0 merged commit 19f999f into AppFlowy-IO:main Sep 11, 2023
q200892907 added a commit to q200892907/appflowy-editor that referenced this pull request Sep 13, 2023
* main:
  chore: refactor attribute comparison in Delta class diff loop (AppFlowy-IO#456)
  fix: duration cannot be zero in animate (AppFlowy-IO#452)
  chore: update Chinese l10n (AppFlowy-IO#445)
  fix: sometimes failed to paste content from google translation (AppFlowy-IO#451)
  feat: refactor color conversion method to handle RGB and hex formatsRefactor method to handle RGB and hex formats, improving color conversion (AppFlowy-IO#450)
  fix: unable to paste html contains section (AppFlowy-IO#448)
  fix: remove unused check in non_delta_input_service (AppFlowy-IO#447)
  feat: optimize the performance (AppFlowy-IO#442)
  refactor: migrate tests (AppFlowy-IO#438)
  feat: bulk open links shortcut (AppFlowy-IO#419)
  fix: request focus in find replace menu (AppFlowy-IO#440)
  feat: implement delta diff and provide external values (AppFlowy-IO#444)
@q200892907 q200892907 mentioned this pull request Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvements improvements on an existing feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant