Kungsgeten / org-brain

Org-mode wiki + concept-mapping
MIT License
1.73k stars 104 forks source link

How many nodes can org-brain handle? #396

Open borgauf opened 8 months ago

borgauf commented 8 months ago

I haven't really reviewed the code, but I see org-brain works with org-id-locations, and I assume that calling org-brain-visualize traverses all the org files and their headers in the org brain directory, then loads into live memory, true? You're not using any of the standard graph data structures, storage methods, correct? So how big can my org brain get be before it's too big and performance lags?

Kungsgeten commented 8 months ago

I don't know, I haven't stressed tested it.

borgauf commented 7 months ago

AFAICT, org-brain really doesn't "read in" all of a brain's entries and establish some in-memory cache for that whole brain, correct? It is only your visualize functionality that actually crawls JIT and creates the visualize view in the buffer, right? Also, there's no real way with org-brain to do a query or filter -- other than some terminal-level grep, or an org-mode tags filter, correct?

Kungsgeten commented 7 months ago

The entries are cached and stored in memory after the first "scan" of a session. I think there are ways to store the cache to disk.

There's no queries provided by org-brain no. What kind of queries are you thinking of?

Den tis 19 mars 2024 22:54Galaxy Being @.***> skrev:

AFAICT, org-brain really doesn't "read in" all of a brain's entries and establish some in-memory cache for that whole brain, correct? It is only your visualize functionality that actually crawls JIT and creates the visualize view in the buffer, right? Also, there's no real way with org-brain to do a query or filter -- other than some terminal-level grep, or an org-mode tags filter, correct?

— Reply to this email directly, view it on GitHub https://github.com/Kungsgeten/org-brain/issues/396#issuecomment-2008198785, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6KZOKSEMXCMBSTDRRO2ZDYZCX3DAVCNFSM6AAAAABEZ4ZZK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBYGE4TQNZYGU . You are receiving this because you commented.Message ID: @.***>

borgauf commented 7 months ago

I've been studying the code, but I'm not finding where this first scan happens and how this cache is built. What is the very first entry point? I'm guessing the org-brain-visualize function. There's a section where it askes for "Entry: " with one option being "all" but I can't figure out how this list gets populated. I'm guessing it must be from this first-read cache that I can't find. Any help appreciated.

Kungsgeten commented 7 months ago

Headline entries are cached in the variable org-brain-headline-cache. This is populated by org-brain-headline-entries-in-file. File entries aren't cached. Lots of functions in org-brain need to get all entries, and upon doing so org-brain-headline-entries-in-file is run one way or another.