[PR #4120] [MERGED] feat: optimize editor memory usage #6072

Closed
opened 2026-03-23 22:21:35 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/4120
Author: @LucasXu0
Created: 12/8/2023
Status: Merged
Merged: 12/10/2023
Merged by: @LucasXu0

Base: mainHead: memory_optimize


📝 Commits (1)

  • f785ac2 feat: optimize editor memory usage

📊 Changes

13 files changed (+212 additions, -201 deletions)

View changed files

frontend/appflowy_flutter/devtools_options.yaml (+1 -0)
📝 frontend/appflowy_flutter/ios/Podfile.lock (+6 -6)
📝 frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/row_document.dart (+31 -36)
📝 frontend/appflowy_flutter/lib/plugins/document/application/doc_bloc.dart (+37 -35)
📝 frontend/appflowy_flutter/lib/plugins/document/document_page.dart (+59 -82)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart (+0 -1)
📝 frontend/appflowy_flutter/lib/startup/tasks/memory_leak_detector.dart (+57 -32)
📝 frontend/appflowy_flutter/lib/workspace/application/doc/doc_listener.dart (+4 -2)
📝 frontend/appflowy_flutter/lib/workspace/application/favorite/favorite_listener.dart (+1 -0)
📝 frontend/appflowy_flutter/lib/workspace/presentation/home/desktop_home_screen.dart (+8 -1)
📝 frontend/appflowy_flutter/packages/appflowy_backend/lib/rust_stream.dart (+4 -2)
📝 frontend/appflowy_flutter/pubspec.lock (+3 -3)
📝 frontend/appflowy_flutter/pubspec.yaml (+1 -1)

📄 Description

Feature Preview

  • dispose the listeners and editor state.
  • upgrade the memory leak free editor.

Open the document page 25 times continually.

Before

67.1 - 55.7 ~= 11MB
Screenshot 2023-12-09 at 00 24 42

After

55.9 - 52.5 ~= 3MB
Screenshot 2023-12-09 at 00 17 25


PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/4120 **Author:** [@LucasXu0](https://github.com/LucasXu0) **Created:** 12/8/2023 **Status:** ✅ Merged **Merged:** 12/10/2023 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `memory_optimize` --- ### 📝 Commits (1) - [`f785ac2`](https://github.com/AppFlowy-IO/AppFlowy/commit/f785ac208ed75c391fa1a7862f8b0711dc29822d) feat: optimize editor memory usage ### 📊 Changes **13 files changed** (+212 additions, -201 deletions) <details> <summary>View changed files</summary> ➕ `frontend/appflowy_flutter/devtools_options.yaml` (+1 -0) 📝 `frontend/appflowy_flutter/ios/Podfile.lock` (+6 -6) 📝 `frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/row_document.dart` (+31 -36) 📝 `frontend/appflowy_flutter/lib/plugins/document/application/doc_bloc.dart` (+37 -35) 📝 `frontend/appflowy_flutter/lib/plugins/document/document_page.dart` (+59 -82) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart` (+0 -1) 📝 `frontend/appflowy_flutter/lib/startup/tasks/memory_leak_detector.dart` (+57 -32) 📝 `frontend/appflowy_flutter/lib/workspace/application/doc/doc_listener.dart` (+4 -2) 📝 `frontend/appflowy_flutter/lib/workspace/application/favorite/favorite_listener.dart` (+1 -0) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/home/desktop_home_screen.dart` (+8 -1) 📝 `frontend/appflowy_flutter/packages/appflowy_backend/lib/rust_stream.dart` (+4 -2) 📝 `frontend/appflowy_flutter/pubspec.lock` (+3 -3) 📝 `frontend/appflowy_flutter/pubspec.yaml` (+1 -1) </details> ### 📄 Description <!--- Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw). --> <!--- If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section. --> ### Feature Preview - dispose the listeners and editor state. - upgrade the memory leak free editor. **Open the document page 25 times continually.** #### Before **67.1 - 55.7 ~= 11MB** <img width="1481" alt="Screenshot 2023-12-09 at 00 24 42" src="https://github.com/AppFlowy-IO/AppFlowy/assets/11863087/5825938c-e027-4acf-bbf7-1d7fa81c39fb"> #### After **55.9 - 52.5 ~= 3MB** <img width="1456" alt="Screenshot 2023-12-09 at 00 17 25" src="https://github.com/AppFlowy-IO/AppFlowy/assets/11863087/11d7a2c0-8ee8-4122-9a4b-2dfdfe299d6b"> <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [x] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/conventions) - [x] I've listed at least one issue that this PR fixes in the description above. - [ ] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [ ] All existing tests are passing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 22:21:35 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#6072
No description provided.