I still don't understand why its so slow for you, on a recent machine Sage startup with warm cache should be around 1s.
Playing around with the startup a bit, I noticed that the notebook stuff imports a lot during startup. Why do we need to import anything from the notebook except the notebook() function? This seems wasteful. Cutting out the notebook imports saves me about 1/4 of the startup time (from ~1s to 0.75s). We also have a lot of stuff in the sys.path that causes many failed open() calls upon startup as Python has to check every directory for modules. About half of all are notebook-related python packages that have no use in mathematics. These are also subdirectories of site-packages so they are searched twice since site-packages is also is sys.path. Just getting rid of packages that are only used in the notebook saves about a third of all open() calls during startup. But on my laptop that only saves something on the order of 0.01s, basically nothing. But if you have a slow file system then it might make a difference. On Friday, August 10, 2012 8:51:17 PM UTC-4, William wrote: > > Hi, > > I'm sad that on a fast SSD repeatedly doing the following: > > wstein@geom:/usr/local/sage/sage-5.2$ time echo "" | ./sage > ---------------------------------------------------------------------- > | Sage Version 5.2, Release Date: 2012-07-25 | > | Type "notebook()" for the browser-based notebook interface. | > | Type "help()" for help. | > ---------------------------------------------------------------------- > sage: sage: > Exiting Sage (CPU time 0m0.03s, Wall time 0m0.03s). > > real 0m1.902s > user 0m1.428s > sys 0m0.424s > > always outputs 1.9 seconds! That test was < 1 second on sage.math > when I put in a doctest to make sure it didn't exceed that 1 second, > when we were trying to improve the sage startup time. In the > intervening year (?), the test is ignored or gone, and the startup > time seems to have got a bit worse. Dang. > > On another faster machine, I'm getting: > > wstein@combinat:/usr/local/sage/sage-5.2$ time echo "" | ./sage > ---------------------------------------------------------------------- > | Sage Version 5.2, Release Date: 2012-07-25 | > | Type "notebook()" for the browser-based notebook interface. | > | Type "help()" for help. | > ---------------------------------------------------------------------- > sage: sage: > Exiting Sage (CPU time 0m0.04s, Wall time 0m0.05s). > > real 0m1.580s > user 0m1.224s > sys 0m0.356s > > > Any ideas? > > > > > William > > > > > -- > William Stein > Professor of Mathematics > University of Washington > http://wstein.org > -- -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org