Processing Modified Files Slow

Hi All,

Long time, no post, mostly because I’ve been happily using org-roam without issues. After updating some packages, though, I decided to tackle a minor nuisance with org-roam, and so far I’ve been unable to fix it, and I’d appreciate any help you’d be willing to share.

When I first start org-roam (I have it set in straight to defer loading to speed up Emacs’s load time, so it starts up the first time I run org-roam-node-find), I get the message “clearing deleted files,” which usually resolves in ~10 seconds (itself somewhat strange, since I haven’t deleted any files), but then it moves onto “Processing modified files,” which takes several minutes. Once initialized, there’s no more performance issues until I close and re-open Emacs, and since I usually keep Emacs open, it only pops up occasionally, which is why I hadn’t resolved it yet.

From reading this post and a couple of others, my initial hypothesis was that the trouble was that I had my org-roam directory in my dropbox directory, and so maybe dropbox was doing something with all of the files on a regular basis, causing them to show up as “modified.” Acting on this hypothesis, I copied my org-roam directory to my home directory (/users/jeff/), deleted org-roam.db, and then initialized Org-Roam to rebuild the database. After doing this, however, the issue persists. I don’t think it’s due to actual modifications in the files, as it persists even when I’ve made no changes between sessions, or have only modified one or two files.

Any thoughts on further hypotheses I should explore to narrow down what might be causing this? The only next step that comes immediately to mind is to disable all other packages besides org-roam and its dependencies and see if I get the same issue, but if anyone has any pointers to a more informative direction to explore, it’d be much appreciated.

Thanks much,

Jeff

Org-roam uses hash (sha1) of the file content to judge if a file has changed or not for each and every file in org-roam-directory. (see function org-roam-db–file-hash). See the lines below.

You say “since I usually keep Emacs open, it only pops up occasionally”. I will assume all files are being re-inserted into org-db. This is weird. It should not happen at all. It means your file contents have changed so that the sha1 hash of each and every file content has changed…. Something at the OS level may be changing the file continent periodically? Do you have a cron job or systemd service (or whatever your OS does in the background)? I think even adding a space at the end of the file will change the hash of the file.

File encryption?

Hmmm, it could be file encryption, as I think Mac OS (Sequoia 15.7.3) does that by default, if I remember right, but I’ll have to dig into that a bit. Thanks for the pointers.