On Thu, Oct 29, 2009 at 10:48 AM, Jason Grout
<jason-s...@creativetrax.com> wrote:
>
> William Stein wrote:
>
>> Speaking of startup time, I'm sad that numpy, matplotlib, etc., all
>> get imported by default again, hence  "sage -startuptime" is bad
>> again.   We need to stop having all those slow-to-import modules get
>> imported by default once and for all (by adding and keeping doctests
>> around that verify that these modules aren't imported).
>>
>
> What *exactly* is forbidden?  I didn't know that matplotlib was
> forbidden, but I've taken great care to not import numpy by default.
>

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.

Despite us both trying, numpy and matplotlib now are both imported by
default.  Incidentally, it's a bit ironic to say that you took care
not to import numpy without worrying about matplotlib, because numpy
arrays are a basic datastructure matplotlib, so I think importing
matplotlib imports numpy.

flat:ggz wstein$ sage -startuptime |grep numpy|wc -l
      50
flat:ggz wstein$ sage -startuptime |grep matplotlib|wc -l
      17

Anyway, actually looking at the output of startuptime reveals this:

            sage.plot.all: 0.500 (cubegroup)
             plot: 0.491 (sage.plot.all)
             ...
              matplotlib.ticker: 0.453 (plot)
                 ...
                 matplotlib.colors: 0.249 (rcsetup)
                  numpy: 0.219 (matplotlib.colors)

So in fact plotting now imports matplotlib, which import numpy.
This might be because of the new (massively awesome!!) switch to using
matplotlib axes that you did...

I'm not trying to blame anybody, but just to raise awareness about an issue.

In the longrun this can be fixed by including some doctests with lines
like this:

sage: os.popen('sage -startuptime|grep matplotlib |wc -l').read().strip() == '0'
True

or something else that encapsulates this nicely.

 -- 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to