Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow and blocking start due to the use of systemlist() #161

Open
lucc opened this issue Dec 15, 2018 · 3 comments
Open

Slow and blocking start due to the use of systemlist() #161

lucc opened this issue Dec 15, 2018 · 3 comments

Comments

@lucc
Copy link

lucc commented Dec 15, 2018

Sometimes when I start neovim on a haskell file (nvim Foo.hs) I have a blank neovim screen sitting there for a while only showing the message "Foo.hs" 221 lines, 8209 characters at the bottom. It can take several seconds until the file is displayed.

Looking at running processes I see stack path --config-location which is called by intero with systemlist(). Now as the :help indicates systemlist() is the old and blocking way to call external processes. And the new job*() api is already extensively used by this plugin. So I suggest to replace all remaining system*() calls with job*() calls to make intero-neovim fully async.

@parsonsmatt
Copy link
Owner

I'm in favor of this! Thanks for reporting the improvement :)

@rdnetto
Copy link
Collaborator

rdnetto commented Dec 15, 2018

+1 for replacing all usages of systemlist().

That said, it might be worthwhile trying to understand why that command takes so long. (I was able to reproduce it taking several seconds by running it directly, but only the first time, which makes me suspect something is getting cached.)

@lucc
Copy link
Author

lucc commented Dec 15, 2018

I had a look at the code and it was not obvious/simple how to refactor it because the return value of the call is used later on. If the variable is set asynchronously it might be accessed before it was set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants