Canna71 / obsidian-chronology

Other
100 stars 7 forks source link

Blocking on UI thread #23

Closed nidhoggr-nil closed 10 months ago

nidhoggr-nil commented 1 year ago

It seems like chronology is blocking the UI thread when updating itself, leading to stuttering when writing things. Correct me if I'm wrong, but I've traced it to the function 'getNotesForCalendarItem' which had a time of 137.9 ms to update which blocked input in obsidian.

image

Canna71 commented 11 months ago

How many notes do you have in your vault? 140ms don't seem to much honestly if you have a big vault.

stoweboyd commented 11 months ago

I have a large vault, and recently noticed that the editor seemed to be lagging while typing. I tried divide and conquer, and stumbled on a configuration that disabled chronology, and the lag went away.

Canna71 commented 11 months ago

I see... I will analyze the issue and will probably apply some debouncing to the update in order not to apply the filtering at every change.

Canna71 commented 11 months ago

In 1.1.10 I added the option to disable the "heat" indication from the cells. This causes computation for each day of the month and with big Vault could be slow. I also increased the timeout from a change to when the view is updated. Could you try v 1.1.10 and maybe disable the Compute Heap option and see if this solves your issue?

jerviscui commented 11 months ago

I found the same problem, I turned on monitoring and found that chronology paused my obsidian for 6 seconds.

Is it possible that the chronology work is triggered every time a file is saved?

jerviscui commented 11 months ago

Now, disable Compute Heat options, it works fine!

Canna71 commented 11 months ago

@jerviscui yes, it is triggered because every time a file is saved the modification date changes. Unfortunately computing the heatmap is quite slow since it isn't indexed yet. I will work on that.

Canna71 commented 11 months ago

I released a preview version that should work fine also with the heat map calculation active.