neuron-v2.vim icon indicating copy to clipboard operation
neuron-v2.vim copied to clipboard

Make use of --cache by running neuron gen as background process

Open chiefnoah opened this issue 4 years ago • 3 comments

Per the neuron documentation, we can likely see significant performance improvements with large zettelkastens if we run neuron gen as a background/daemon process and use --cached on query commands.

We can optionally run neuron's web UI as a configurable option, though I am against having it run the web server by default.

chiefnoah avatar Feb 20 '21 16:02 chiefnoah

From testing this out a bit, the biggest offender is func! s:refresh_backlink_cache_for_zettel(id), and using --cached there sees enormous performance gains.

vcavallo avatar Feb 24 '21 21:02 vcavallo

Yeah, that's pretty much what I expected. Keep in mind, it could quickly become out of date without the mentioned change of having neuron gen in the background.

chiefnoah avatar Feb 24 '21 22:02 chiefnoah

I'm not familiar with the code base and I'm not fluent in VimL but there seems to be a bug where once you create a new zettel (via gzn), refresh_backlink_cache_for_zettel gets called on each writes.

I suspect it's because g:_neuron_must_refresh_on_write is never set back to 0.

Side note, the performance cost incurred just to be able to show the number of backlinks to a given zettel seems unreasonable.

edit: forgot to add that using --cached should be the default behavior in my opinion until the performance issue can be solved.

pyrho avatar Apr 29 '21 12:04 pyrho