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

Don't list pygments styles on import #10859

Merged
merged 2 commits into from
Oct 20, 2017

Conversation

takluyver
Copy link
Member

Listing the styles forces pygments to load plugins, which slows startup and may cause unexpected errors from other packages. We shouldn't be calling this on import.

The list of available styles will also depend on what packages are installed, so building our config docs with one list may be misleading. I've made the help string point to pygmentize -L styles to see available styles on your system.

Closes jupyter/notebook#2926

Listing pygments styles forces pygments to load plugins, which slows startup and
may cause unexpected errors from other packages.

Closes jupyter/notebook#2926
@takluyver
Copy link
Member Author

With this change, I see a reduction in cold-start time from ~11 seconds to ~6 seconds (this is on a spinning metal hard drive), and a reduction in warm start from ~1.1s to ~0.9s.

@takluyver
Copy link
Member Author

I'll merge this tomorrow unless someone says otherwise.

@takluyver takluyver merged commit 81f2348 into ipython:master Oct 20, 2017
takluyver added a commit that referenced this pull request Oct 20, 2017
@takluyver takluyver deleted the dont-list-pygments-styles branch October 20, 2017 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant