黄煜 <hyto...@stu.pku.edu.cn> writes:

> 2. When running save-buffer-kill-emacs, the time has been reduced from about 
> 5 minutes to 2-3s (turning off org-roam-autosync-mode). For my current needs, 
> this speed is more than satisfactory. However, according to previous 
> statement last year, this speed would rapidly decrease as the scale of the 
> fragments increase because of the usage of pp, correct? 

It might. Using `pp' was dropped for writing cache data, but it is still
used for index.eld file (I was hoping to keep this file readable).

If we come to the point when index file is causing significant slowdowns
and cannot solve the slowdowns in any other way, `pp' can be dropped
completely.

> I attach the profiler for the convenience of any future performance 
> enhancement.

Thanks!
>From the profile (without async-mode), I see that rename-file is taking
significant time.
         356  16% + rename-file
         267  12% + write-region

I added that call to `rename-file' attempting to fix
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75209, but the bug is
still there, so things are not quite as simple.

> P.S. During the test, I discovered that, if someone uses org-roam and turns 
> on autosync-mode, the `rename-file` function would be overloaded by 
> `org-roam-db--autosync-rename-file-a`, which would occupy half of the total 
> time. Turning off the autosync-mode temporarily will solve this performance 
> problem.

That's a bug in org-roam. Such advices should be written extremely
carefully because they are affecting low-level operations.

> In my view, org-persist only process those files in memory and the cache 
> directory and not interactive with the org-roam-directory, right? 

org-persist only writes of org-persist-directory, but the org-roam's
advice does not appear to be very selective.

> P.S.2 I am pretty new to Emacs community and I cc this reply to 
> emacs-orgmode@gnu.org. I hope it would appear in the org maillist archive.

You were not subscribed, so your email had to go through human
moderation before it went to the public archives.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to