Hi gang, I’ve taken on a member role in the org-roam organization to help shepard the project along. This year I was able to bring things up to speed with built-in SQLite support for Emacs 29 and later, and work through CI issues. We have started addressing what I think is the biggest class of issues: performance. A PR to improve org-roam-node-find
performance was recently merged, and v2.3 was released to melpa-stable (after 3 years since the last release).
I won’t be doing the lion’s share of active development myself, but will support those who do — and there are a few eager folks working at it.
There are a ton of open issues and PRs in GitHub and a lot of them are quite old and have gone stale. I’m going to set up a workflow to auto-close dormant issues after 6 months of inactivity with a 2 week warning comment. If you have an issue or PR that you’ve been following and would like to see attended to, please give it a ping in the comment thread.
I love org-roam. I use it every day. I appreciate this community and look forward to giving back.
5 Likes
It may be worth looking into GitHub - meedstrom/org-node: A notetaking system like Roam using Emacs Org-mode by @meedstrom1 . It reimplements many org-roam features but with a different and more performant database backend. Perhaps some of these improvements can be brought back to org-roam.
To see some perf fixes for the *org-roam*
buffer, you can check out what org-node-roam-accelerator-mode does! I meant to upstream at some point but, uh, life. Happy to answer any questions.
1 Like
@dustinfarris Thank you for all you do! Happy to see v2.3 published. You are doing herculean work.
Perhaps I can join force with you, do my bits and try to update the documentation – I have been wanting to go back to Zero-to-Emacs-and-Org-roam guide – but instead (and additionally), I could send some PR for the official documentation to be in line with Emacs 29 with SQLite embedded… Not immediately. I am pacing myself, looking at the rest of year 2025.
1 Like
org-node-roam-accelerator-mode
will definitely check this out — i’d very much like your work to be brought in. totally understand about “life”!
Thanks @nobiot — your past contributions and participation in the community are a big part of what makes org-roam great. No pressure to do all the things all at once. I would like to see the following done by EOY, somewhat in order of priority:
Bug fixes
Performance improvements
Better test coverage
Documentation updates
And then start looking at new features.
1 Like
akashp
June 4, 2025, 10:06am
8
** Suggestions for temporary buffers
Fixes, performance
Org roam mode
(defmacro org-roam-with-temp-buffer (file &rest body)
"Execute BODY within a temp buffer.
Like `with-temp-buffer', but propagates `org-roam-directory'.
If FILE, set `default-directory' to FILE's directory and insert its contents."
(declare (indent 1) (debug t))
(let ((current-org-roam-directory (make-symbol "current-org-roam-directory")))
`(let ((,current-org-roam-directory org-roam-directory))
(with-temp-buffer
(let ((org-roam-directory ,current-org-roam-directory)
;; HHHH---------------------------------------------------
(org-inhibit-startup t))
;; HHHH---------------------------------------------------
(delay-mode-hooks (org-mode))
(when ,file
(insert-file-contents ,file)
(setq-local default-directory (file-name-directory ,file)))
,@body)))))
Simple cache design
@bradmont
Not, really but update the code then, I am giving you a more streamlined code block, replace the previous one with this
(defvar org-roam-buffer-last-node nil
"Stores the last visited Org-roam node for delayed redisplay.")
(defun org-roam-buffer--scheduled-redisplay-h ()
(and (get-buffer-window org-roam-buffer)
(org-roam-buffer--scheduled-fn)))
(defun org-roam-buffer--scheduled-fn ()
(when-let ((node (org-roam-node-at-point)))
(unless (equal node org-roam-buffer-las…
Wrap org-mode inside delay-mode-hooks otherplace
(defun modified/org-roam-fontify-like-in-org-mode (s)
(with-temp-buffer
(insert s)
(let ((org-ref-buffer-hacked t))
;; (org-mode)
(delay-mode-hooks (org-mode))
(setq-local org-fold-core-style 'overlays)
(font-lock-ensure)
(buffer-string))))
(advice-add 'org-roam-fontify-like-in-org-mode
:override
#'modified/org-roam-fontify-like-in-org-mode)
Please consider. Thanks.
akashp
June 4, 2025, 10:08am
9
My suggestions should close
opened 03:29AM - 05 Nov 23 UTC
2. perf
### Description
I have two large files that I have added to org-roam.
- Fi… le 1: 93K lines, 3.8 MB
- File 2: 10K lines, 0.5 MB
Displaying the org-roam buffer on nodes which have backlinks in these files is very slow. The culprit is `org-startup-indented`.
Below are 3 examples with `org-startup-indented` set to `t`or `nil`. Timings are determined with the following function:
```emacs-lisp
(benchmark-run 5 (org-roam-buffer-display-dedicated (org-roam-node-at-point)))
```
#### Node 1 with 5 backlinks:
- 1 backlink in File 1 (93K lines)
- 3 backlinks in File 2 (10K lines)
- 1 additional backlink in very small node file
Timings:
- t: (9.701741 86 5.583931)
- nil: (0.33617 2 0.09160900000000005)
#### Node with 1 backlink in File 1 (93K lines)
Timings:
- t: (5.49469 46 3.1563150000000064)
- nil: (0.138881 0 0.0)
#### Node with backlink into small node files
Timings:
- t: (0.038591 0 0.0)
- nil: (0.022707 0 0.0)
#### Workaround
I use the following advice to temporarily disable `org-indented-startup` around `org-roam-buffer-render-contents`.
```emacs-lisp
(defun vr/org-roam-buffer-render-contents-advice (orig-fun &rest args)
(let ((org-startup-indented nil))
(apply orig-fun args)))
(advice-add 'org-roam-buffer-render-contents :around #'vr/org-roam-buffer-render-contents-advice)
```
This fixes the slowdown. Maybe it should be added to `org-roam-buffer-render-contents`?
#### Steps to Reproduce
Unfortunately, I cannot share the files.
#### Backtrace
Backtrace without the advice on Node 1 with 5 backlinks:
```
2801 50% - ...
2801 50% Automatic GC
2736 49% - command-execute
2619 47% - funcall-interactively
2613 47% - org-ctrl-c-ctrl-c
2612 47% - org-babel-execute-src-block
2611 47% - org-babel-execute:emacs-lisp
2611 47% - progn
2611 47% - benchmark-run
2611 47% - benchmark-call
2611 47% - #<lambda 0x88f56b67>
2611 47% - org-roam-buffer-display-dedicated
2605 46% - org-roam-buffer-render-contents
2605 46% - apply
2605 46% - org-roam-backlinks-section
2596 46% - org-roam-node-insert-section
2523 45% - org-roam-preview-get-contents
2156 38% - org-indent-refresh-maybe
2086 37% - org-indent-add-properties
1284 23% - org-at-item-p
1245 22% - org-list-in-valid-context-p
1186 21% - org-in-block-p
168 3% - org-between-regexps-p
130 2% org-in-regexp
8 0% #<compiled 0x198285068a2f>
2 0% #<compiled 0x198285068a2f>
25 0% org-indent-set-line-properties
277 4% - org-fold-core--fix-folded-region
265 4% - org-fold-core-next-folding-state-change
265 4% #<compiled 0xa17795ce59c2b68>
60 1% - org-roam-preview-default-function
60 1% - org-roam-end-of-meta-data
59 1% - org-back-to-heading-or-point-min
59 1% - org-before-first-heading-p
59 1% - org-element-at-point
59 1% - org-element--parse-to
43 0% + org-element-org-data-parser
8 0% + org-element--current-element
16 0% + org-mode
9 0% + set-auto-coding
1 0% + org-roam-strip-comments
1 0% + org-element--cache-after-change
1 0% #<compiled -0x1dff26aad25534f3>
25 0% + org-roam-fontify-like-in-org-mode
1 0% + magit-section-ident
8 0% + org-roam-backlinks-get
5 0% + org-roam-node-at-point
1 0% org-roam-buffer--dedicated-name
1 0% + org-babel-get-src-block-info
5 0% + execute-extended-command
117 2% - byte-code
117 2% - read-extended-command
117 2% - read-extended-command-1
57 1% - completing-read-default
14 0% + minibuffer-error-function
2 0% + timer-event-handler
6 0% + timer-event-handler
```
#### Expected Results
See above.
#### Actual Results
See above.
### Environment
```
Copy info below this line into issue:
- Emacs: GNU Emacs 29.1 (build 2, aarch64-apple-darwin21.6.0, NS appkit-2113.60 Version 12.7.1 (Build 21G920))
of 2023-11-03
- Framework: Own configuration
- Org: Org mode version 9.6.6 (release_9.6.6 @ /opt/homebrew/Cellar/emacs-plus@29/29.1/share/emacs/29.1/lisp/org/)
- Org-roam: 2.2.2- sqlite-connector: sqlite-builtin
```
And
main
← Sergey-Makarov:fix-1732-broken-org-roam-buffer-display
opened 09:22PM - 26 Mar 23 UTC
###### Motivation for this change
This pull request is aimed to fix the issue w… hen the preview sections of the backlinks inside an org roam buffer are not displayed where they should.
Steps to reproduce:
1. tested only on Spacemacs distro
2. page-break-lines-mode, global-page-break-lines-mode, display-line-numbers-mode and global-display-line-numbers-mode are enabled in org mode buffer
3. invoke org-roam-buffer-toggle to show up an org roam buffer
Result:
<img src="https://user-images.githubusercontent.com/11041382/227804879-656013e7-4b7a-4589-8100-c12281d0e67c.png" height="400">
Also hitting RET on any section inside such buffer would result in the following error message:
```
There is no thing at point that could be visited
```
Result if the fix is applied:
<img src="https://user-images.githubusercontent.com/11041382/227804893-e58bcb32-0dad-4ee9-9a7b-ab79b30cacf9.png" height="400">
What is also interesting is that even without this fix, if we navigated to org roam buffer and called org-roam-buffer-refresh, the buffer would redraw just fine. But if we then navigated back to the original org mode buffer and triggered org roam buffer refresh (by, say, pointing to another node that has it's own backlinks), the problem would occur once again.
I have no clear idea of why this happens, but here is a line that actually caused this issue:
```
(defun org-roam-fontify-like-in-org-mode (s)
"..."
(with-temp-buffer
(insert s)
(let ((org-ref-buffer-hacked t))
(org-mode) ;; after this call, the point inside the org roam buffer is set to 1 for some reason. this is why all the previews are displayed at the top of the buffer
(setq-local org-fold-core-style 'overlays)
(font-lock-ensure)
(buffer-string))))
```
This fix is expected to close these issues:
https://github.com/org-roam/org-roam/issues/1732
https://github.com/syl20bnr/spacemacs/issues/14969
dmg
June 6, 2025, 9:24pm
10
Thank you very much for helping with the development of org-roam. I do too:
I love org-roam. I use it every day. I appreciate this community and look forward to giving back. "
Thanks @akashp . I’m looking these over.
@akashp would you mind approving this?
main
← df/org-inhibit-startup
opened 05:26AM - 07 Jun 25 UTC
The difference is incredible.
You might be surprised to find it gets even faster if you also let-bind org-agenda-files
to nil before enabling org-mode
.
And org-element-cache-persistent
- as it’s a temp buffer, it just causes unnecessary work as far as I’ve understood. Perhaps that should be considered an upstream bug.
So to make a proper org temp buffer:
(let ((org-inhibit-startup t)
(org-agenda-files nil)
(org-element-cache-persistent nil))
(delay-mode-hooks (org-mode))
(setq-local org-element-cache-persistent nil))
Here I’ve set org-element-cache-persistent
twice because enabling any major mode kills all local variables previously present.
1 Like
Very cool! I’ll take a swing at this later today.