neuron-mode
neuron-mode copied to clipboard
Non blocking cache regeneration is very slow
In https://github.com/felko/neuron-mode/commit/09e1f47013cb0fd70e9878713c8b3a4c62c08c2f, I made neuron-refresh run in a thread to avoid blocking Emacs which isn't necessary. However, I noticed that it slowed down cache regeneration by a very large factor (I don't know how much exactly but easily x10).
I have no idea what is causing this, I don't know how emacs lisp threading works internally.
Unless someone finds a fix for this, we have three options:
- forget about the latency, prefer
neuron-refreshto be non blocking over being fast - go back to blocking implementation
- make the behavior configurable
I might have to play with this to see what happens.
Most likely I think neuron will have be optimized for the incremental case (one file changed; then fast update of graph cache on disk).
https://github.com/srid/neuron/issues/321
Thanks for looking into this. This will indeed improve the performance but I'd still like some way to speed up the cache regeneration from emacs which is unreasonably slow. I was thinking that I could use an asynchronous process (start-process-shell-command) instead of spawning an emacs thread.