elixir-extras.nvim icon indicating copy to clipboard operation
elixir-extras.nvim copied to clipboard

Apidocs a bit slow

Open MathieuDR opened this issue 1 year ago • 3 comments

I'm not sure if it has to do with my configuration, or whatever, but it feels a bit sluggish.

Is this to be expected?

MathieuDR avatar Nov 06 '23 23:11 MathieuDR

Yes, that's part of the reason why there is an option for only core functions or not. We're calling the elixir repl functions to extract the data and the repl probably wasn't meant for that.

The speed will depend on the number of dependencies you have (and the speed of your computer obviously). In my case it's quite acceptable.

There would be a solution, that would be caching the data. We could probably store the docs as files on disk, and we would refetch them when the timestamp of the config.exs of the project would change. However that's extra work and I'm not planning to do this for now. I would accept pull requests for that purpose though!

emmanueltouzery avatar Nov 07 '23 05:11 emmanueltouzery

Regarding the core functions or not: if we list only core functions it will be faster. You could probably have two shortcuts for speed, when you know you're interested specially in core functions only (standard library, not all the dependencies you have).

emmanueltouzery avatar Nov 07 '23 05:11 emmanueltouzery

Note that obviously there are probably other avenues for speedup, but they are not obvious to me. I didn't time the runtime of this plugin vs running the repl commands by hand, or possibly the repl could be run differently to gain speed on so. But I don't see how.

emmanueltouzery avatar Nov 07 '23 05:11 emmanueltouzery