neuron-mode icon indicating copy to clipboard operation
neuron-mode copied to clipboard

Non blocking cache regeneration is very slow

Open felko opened this issue 5 years ago • 3 comments

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-refresh to be non blocking over being fast
  • go back to blocking implementation
  • make the behavior configurable

felko avatar Aug 01 '20 10:08 felko

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).

srid avatar Aug 01 '20 12:08 srid

https://github.com/srid/neuron/issues/321

srid avatar Aug 04 '20 14:08 srid

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.

felko avatar Aug 04 '20 15:08 felko