AppFlowy-IO / AppFlowy

Bring projects, wikis, and teams together with AI. AppFlowy is an AI collaborative workspace where you achieve more without losing control of your data. The best open source alternative to Notion.
https://www.appflowy.io
GNU Affero General Public License v3.0
57.82k stars 3.79k forks source link

[Bug] Extreme performance issues Windows #5259

Closed feldroop closed 1 month ago

feldroop commented 6 months ago

Bug Description

When starting the app, it takes easily 5-10 minutes for the inital interface to load. In the past weeks, the startup time slowly creeped up to this extreme amount. Last week it was a couple of seconds, which still felt way too long and longer than previously. During the startup time, the app used 30% of my laptop CPU and was unresponsive. I could only restart by killing the process in the task manager.

After it finally loading, I clicked through my notes. Some of them loaded immedeately, for others I only saw the loading icon. After repeatedly clicking through all of them, even the notes that were initally displayed only showed the loading icon. I waited for minutes and nothing changed. During this time, the app used all of my CPU (90% or more) such than even other apps were starting to be affected.

How to Reproduce

I'm sorry, I don't know. Please let me know if I can help.

Expected Behavior

Normal performance.

Operating System

Windows 10

AppFlowy Version(s)

0.5.1 and 0.5.5

Screenshots

App window during startup AppFlowyBug

Additional Context

My flowy-database.db file is 44 KB.

Log: log.2024-05-04.txt

Another possibly interesting detail: I looked at some previous logs (the performance was already not great then, but the app was still usable) and I found huge files (up to 15 MB) full of the following:

I'm not sure if these are related issues or even issues at all, though.

LucasXu0 commented 6 months ago

Hi, @feldroop. Could you post a screenshot of the task manager showing the memory and CPU usage?

feldroop commented 6 months ago

Hey, here they are. My CPU is an Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz.

While starting: appFlowyTaskManager1

While loading notes (the GPU is only working for a short moment after I interact with the app, but the CPU stays like that): appFlowyTaskManager2

I now let it run for a moment and it finished loading all of the notes. The interface works well and there is no delay, but the CPU usage of the app stays high (70-80%, my laptop is struggling).

fan87 commented 5 months ago

My start up time is also taking too long, it's about 40 seconds, the log didn't help in my case, it just hangs a couple seconds after the websocket initialization, I think it's the same bug

(It was also using 100% CPU, however it's fixed now after an update and I'm not sure how)

Here's the log: log.txt