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

Startup speed (on Windows) #3

Open
cjrh opened this issue Mar 13, 2015 · 10 comments
Open

Startup speed (on Windows) #3

cjrh opened this issue Mar 13, 2015 · 10 comments

Comments

@cjrh
Copy link
Owner

cjrh commented Mar 13, 2015

The vim-conda plugin takes way too long to load, 400-500 ms based on --startuptime timings. The subprocess calls are surely a big chunk, but we can be smarter in how the work gets done.

I'm also thinking it might be a good idea to have a continuously-running process for querying conda things, rather than starting up a subprocess each time.

@cjrh cjrh changed the title Startup speed Startup speed (on Windows) May 12, 2015
@Mistobaan
Copy link

Also in Linux it takes a lot of time. Any clue why?

Top 10 plugins slowing vim's startup
====================================
1        31.292   vim-conda
2        25.968   nerdtree
3        17.585   vim-textobj-entire
4        12.444   syntastic
5        10.103   vim-fugitive
6         6.218   vim-airline
7         4.610   vim-unimpaired
8         4.101   vim-gitgutter
9         2.280   python-mode
10        1.260   vim-test
====================================

@cjrh
Copy link
Owner Author

cjrh commented Nov 22, 2016

Yes, it's because of os calls to look up things in the environment and e.g. run conda info commands and parse the output. It should be fairly easy to optimize, but I have no time for it.

@ryanfreckleton
Copy link
Collaborator

I've got a branch that reduces this startup time to about a third of what it is by using a memoize decorator. The big culprit is running conda info --json, which is needed for default_prefix and envs.

I believe that you can get default_prefix and envs by looking at the output of which python instead of asking conda directly, but haven't had a chance to mess with it entirely.

Please advise on whether there's interest in using the memoize solution, or if I should just open a pull request once I have it working with shell tools.

@jfishe
Copy link
Collaborator

jfishe commented Dec 10, 2017

I haven't played with memoize, but the idea is appealing. I'd be happy to test it for you. I use Windows mostly with some WSL Ubuntu; currently using a link from .vim to my vimfiles, so far without problems.

BTW, on Windows which is spelled where.

@ryanfreckleton
Copy link
Collaborator

Sorry it took me a while to get back to this: I've got a fork at https://github.com/ryanfreckleton/vim-conda/tree/develop which has the modifications to use a caching system which gives quite good speedup.

Please advise whether there's enough interest for me to put together a pull request.

@cjrh
Copy link
Owner Author

cjrh commented Jan 24, 2018

@ryanfreckleton Sure! I've added you as a collaborator so you have commit rights. You'll prob want to put up a PR anyway to get feedback from the others.

@ryanfreckleton
Copy link
Collaborator

Awesome, thanks! I will :)

@ryanfreckleton
Copy link
Collaborator

Pull-request open at #24 I'd like at least one other person to look at it and someone to test it on windows before I merge.

@ryanfreckleton
Copy link
Collaborator

Merged. Could someone on windows please test to see if performance increases?

@jfishe
Copy link
Collaborator

jfishe commented Apr 20, 2018

I see a vim-conda.vim load time improvement from 1554 msec to 781 msec on Windows 10 for conda v4.5.1.

Good job.

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

4 participants