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

Find available kernelspecs more efficiently #3136

Merged
merged 2 commits into from
Dec 19, 2017
Merged

Conversation

takluyver
Copy link
Member

Using find_kernel_specs() followed by get_kernel_spec() has quadratic performance with the number of available kernels, because it effectively rescans for each available kernel. Hands up, I designed this, and I can't think why I did it this way.

I thought this was going to require some ugly workaround, but thankfully @captainsafia was on the case two years ago, adding the get_all_specs() method (jupyter/jupyter_client#93). So all I've done here is switch the notebook code to use it.

This should improve performance loading pages for anyone with several kernels installed.

Closes gh-3135

@takluyver
Copy link
Member Author

It's failing the test for listing kernelspecs when one is invalid, and I don't think that can easily be fixed here; I'll need to change it in jupyter_client.

@takluyver
Copy link
Member Author

Reopening to test with jupyter_client 5.2, which was just released.

@takluyver takluyver closed this Dec 18, 2017
@takluyver takluyver reopened this Dec 18, 2017
@blink1073
Copy link
Member

blink1073 commented Dec 18, 2017

Looks like appveyor will fail until the jupyter_client conda package makes its way through the wickets.

@takluyver
Copy link
Member Author

Reopening to test with jupyter_client 5.2, which was just released.

@takluyver takluyver closed this Dec 19, 2017
@takluyver takluyver reopened this Dec 19, 2017
setup.py Outdated
@@ -148,7 +148,7 @@
'ipython_genutils',
'traitlets>=4.2.1',
'jupyter_core>=4.4.0',
'jupyter_client',
'jupyter_client>=4.2.0',
Copy link
Member

@minrk minrk Dec 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5.2, since it needed that to pass the tests? Or is the invalid-spec issue separate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it probably should be 5.2.

@blink1073
Copy link
Member

Thanks!

@blink1073 blink1073 merged commit 782e9ce into jupyter:master Dec 19, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jupyter Kernel Spec + N times refreshing for N Kernels + Slow start up
3 participants