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
takluyver
merged 2 commits into
ipython:master
from
takluyver:dont-list-pygments-styles
Oct 20, 2017
Merged
Don't list pygments styles on import #10859
takluyver
merged 2 commits into
ipython:master
from
takluyver:dont-list-pygments-styles
Oct 20, 2017
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Listing pygments styles forces pygments to load plugins, which slows startup and may cause unexpected errors from other packages. Closes jupyter/notebook#2926
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. |
I'll merge this tomorrow unless someone says otherwise. |
takluyver
added a commit
that referenced
this pull request
Oct 20, 2017
Backport PR #10859 on branch 5.x
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Aug 5, 2018
Among other improvements in these bugfix releases, the [[https://ipython.readthedocs.io/en/5.x/whatsnew/version5.html|IPython 5.x release notes]] mention that - IPython should start faster, as it no longer looks for all available pygments styles on startup ([[ipython/ipython#10859 #10859]]). - Update inspecting function/methods for future-proofing (a patch meant for Sage). '''Tarball''': - https://files.pythonhosted.org/packages/41/a6/2d25314b1f9375639d8f8e0f 8052e8cec5df511d3449f22c4f1c2d8cb3c6/ipython-5.8.0.tar.gz URL: https://trac.sagemath.org/25083 Reported by: slelievre Ticket author(s): Jeroen Demeyer Reviewer(s): Travis Scrimshaw
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Aug 10, 2018
Among other improvements in these bugfix releases, the [[https://ipython.readthedocs.io/en/5.x/whatsnew/version5.html|IPython 5.x release notes]] mention that - IPython should start faster, as it no longer looks for all available pygments styles on startup ([[ipython/ipython#10859 #10859]]). - Update inspecting function/methods for future-proofing (a patch meant for Sage). '''Tarball''': - https://files.pythonhosted.org/packages/41/a6/2d25314b1f9375639d8f8e0f 8052e8cec5df511d3449f22c4f1c2d8cb3c6/ipython-5.8.0.tar.gz URL: https://trac.sagemath.org/25083 Reported by: slelievre Ticket author(s): Jeroen Demeyer Reviewer(s): Travis Scrimshaw
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
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