On Thu, Oct 29, 2009 at 3:44 PM, Robert Bradshaw <rober...@math.washington.edu> wrote: > > On Oct 29, 2009, at 3:39 PM, William Stein wrote: > >> On Thu, Oct 29, 2009 at 3:27 PM, Jason Grout >> <jason-s...@creativetrax.com> wrote: >>> >>> William Stein wrote: >>>> Nothing is "forbidden" yet, but we should try not to load whatever >>>> we >>>> can get away with not loading in order to improve the import time. >>> >>> Well, it sounds like you are forbidding matplotlib and numpy being >>> loaded at startup, if you're making a doctest for that. >> >> Yes, I would like to propose forbidding it, unless we can't find a way >> around it. > > I agree. It's gotten to the point where I'll fire up sage -python or > sage -ipython sometimes, just because starting sage takes too long if > I just want to do something trivial.
Right now it takes 1.874 - 2.286 seconds on my new solid-state disk macbook air laptop to startup sage-4.2, and this is from a warm cache (i.e., the stable state after multiple starts). The first startup (before steady state) is about 5.5 seconds. On Linux with a local disk (sage.math) the startup time form me is about 1.230 seconds. The first try had the same time as subsequent starts, which is surprising... but I guess Linux on a box with 128GB RAM could be very good at disk caching. The point is that the 2 seconds should be 0.5 seconds. There are many things that caused this. I'm just looking at the output of "sage -startuptime" to see. One example: sage.server.all: 0.270 (sage.all) notebook.all: 0.268 (sage.server.all) sage.server.notebook.notebook: 0.239 (notebook.all) css: 0.025 (sage.server.notebook.notebook) sage.server.notebook.template: 0.025 (css) jinja: 0.022 (sage.server.notebook.template) jinja.environment: 0.021 (jinja) ... sphinx.application: 0.124 (cell) So... we're importing jinja and sphinx for the (old) notebook every time Sage starts, and this takes a significant amount of time. This is *never* used unless you actually run the notebook... in which case it still isn't used, since the notebook runs in its own separate process (and it's used by that process). The singular interface also looks like a *major* culprit: sage.interfaces.singular: 0.329 (sage.rings.ideal) sage.structure.sequence: 0.000 (sage.interfaces.singular) Looking, I see that a *horrendously* time consuming function called "generate_docstring_dictionary()" is called whenever the file sage/interfaces/singular.py is imported. This is completely pointless, and shouldn't happen until somebody actually tries to use the singular interface. A few lines of code would immediately reduce the startup time of Sage by nearly a half second there. Since this Singular issue is pretty straightforward to fix, and will result in a huge win, I've made a ticket: http://trac.sagemath.org/sage_trac/ticket/7351 -- William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---