Boostnote: High CPU usage during typing of larger notes

Created on 18 Oct 2016  路  5Comments  路  Source: BoostIO/Boostnote

I noticed today, that the CPU usage of Boostnote has a peak when I'm enter one character inside a note. This peak adds a delay to the typing and the editor feels slower (which is increasing with the size of the note). It happens for me only in larger notes (>100 lines of code).
I guess this is due to the notefile writing after each character but hadn't any look into the code yet. If this is the case, I would suggest that Boostnote should only write the file in a background thread every 10 seconds of if there is no note input anymore for X (e.g. 5) seconds.

Hardware: MacBook Air 2010 including a SSD. Will try this later on my workstation.

Most helpful comment

It should be. I'll tackle it on this week.

All 5 comments

I can confirm this behaviour, and the suggested fix sounds good.

It should be. I'll tackle it on this week.

I think this is a problem of renderer. The cost of writing text is very cheap.

Preview will be rendered after 0.5 seconds from last edit. https://github.com/BoostIO/Boostnote/commit/0445c680baf85378599bf4f585b4df657b29bf7a

To tackle this more, we need to implement partial rendering.
Check this comment. https://github.com/BoostIO/Boostnote/issues/116#issuecomment-254729326

Yes, from the profiler, it looks like it is the renderer :)
bildschirmfoto 2016-10-26 um 08 06 32

Was this page helpful?
0 / 5 - 0 ratings