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

lazy import module #7502

Closed
robertwb opened this issue Nov 20, 2009 · 11 comments
Closed

lazy import module #7502

robertwb opened this issue Nov 20, 2009 · 11 comments

Comments

@robertwb
Copy link
Contributor

This is something I came up with when trying to reduce sage start up time.

2.033 sage.all (None)
0.407 sage.server.all (sage.all)
0.404 notebook.all (sage.server.all)
0.365 sage.server.notebook.notebook (notebook.all)
...

Now notebook() needs to be in the global namespace, but usually the entire notebook server does not need to be loaded. I'm sure there's other trimming we could do here as well.

It's unclear what level to put this in, but I would think sage.server.notebook.all would be a good place (e.g. we could lazily import interact., sage_email., and lazily import notebook and inotebook). That could cut down startup time by 25%.

Component: user interface

Author: Robert Bradshaw

Reviewer: Mitesh Patel

Merged: sage-4.3.2.alpha1

Issue created by migration from https://trac.sagemath.org/ticket/7502

@robertwb
Copy link
Contributor Author

Attachment: 7502-lazy-import.patch.gz

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 28, 2010

comment:1

Somewhat related: #8102 + #8107 reduce the startup time by cutting unnecessary imports.

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 28, 2010

comment:2

By the way, is this up for review?

@robertwb
Copy link
Contributor Author

comment:3

Yes.

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 30, 2010

Attachment: 7502-lazy-import.2.patch.gz

Also map tab completion. Add to reference manual. Rebased vs. 4.3.2.alpha0. Replaces previous.

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 30, 2010

Author: Robert Bradshaw

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 30, 2010

Reviewer: Mitesh Patel

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 30, 2010

comment:4

My review is positive, but someone should review the changes in v2.

@robertwb
Copy link
Contributor Author

comment:5

Thanks. Yes, your additions look good as well.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jan 30, 2010

Merged: sage-4.3.2.alpha1

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jan 30, 2010

comment:6

Merged 7502-lazy-import.2.patch.

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

2 participants