AppFlowy icon indicating copy to clipboard operation
AppFlowy copied to clipboard

[Bug] Extreme performance issues Windows

Open feldroop opened this issue 9 months ago • 3 comments

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:

  • MANY lines exactly like this: {"msg":"Failed to send message to channel: channel closed","target":"client_api::ws::handler"}

  • Many lines similar to this: {"msg":"request_id: "a4a61941f44ac4f954624f0fb3f50c50"","target":"client_api::http"}

  • Lines like this: {"msg":"aa79b4ef-94f5-5b08-92de-76dcb582697f expect message id:78145, but receive:78233","target":"client_api::collab_sync::sink"}

  • Lines like this: {"msg":"IO error: Eine vorhandene Verbindung wurde vom Remotehost geschlossen. (os error 10054)","target":"client_api::ws::client"} (Translation by me: An existing connection was closed by the remote host)

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

feldroop avatar May 04 '24 13:05 feldroop

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

LucasXu0 avatar May 07 '24 01:05 LucasXu0

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).

feldroop avatar May 09 '24 14:05 feldroop

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

fan87 avatar May 19 '24 00:05 fan87