2.10 Importing Modules

Do not import at the top level of your module a third-party module that will take a long time to initialize (e.g., matplotlib). It is important that from sage.all import * not take forever, since this is what dominates the Sage startup time.

On a somewhat regular basis I do the following:

  echo "%prun import sage.all" | sage -ipython|more
in order to profile what is taking a long time during the load. In many cases I use the locate command to find files mentioned in the profile.

See About this document... for information on suggesting changes.