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

Projects
None yet
1 participant
@takluyver
Member

takluyver commented Oct 12, 2017

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

takluyver added some commits Oct 12, 2017

Don't list pygments styles on import
Listing pygments styles forces pygments to load plugins, which slows startup and
may cause unexpected errors from other packages.

Closes jupyter/notebook#2926

@takluyver takluyver added this to the 5.6 milestone Oct 12, 2017

@takluyver

This comment has been minimized.

Member

takluyver commented Oct 12, 2017

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

This comment has been minimized.

Member

takluyver commented Oct 18, 2017

I'll merge this tomorrow unless someone says otherwise.

@takluyver takluyver merged commit 81f2348 into ipython:master Oct 20, 2017

4 checks passed

codecov/patch 100% of diff hit (target 0%)
Details
codecov/project Absolute coverage decreased by -<.01% but relative coverage increased by +32.97% compared to d29752e
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

meeseeksdev bot pushed a commit that referenced this pull request Oct 20, 2017

takluyver added a commit that referenced this pull request Oct 20, 2017

@takluyver takluyver deleted the takluyver:dont-list-pygments-styles branch Oct 20, 2017

vbraun added a commit to vbraun/sage that referenced this pull request Aug 5, 2018

Trac #25083: Upgrade to IPython 5.8
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 added a commit to vbraun/sage that referenced this pull request Aug 10, 2018

Trac #25083: Upgrade to IPython 5.8
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