Re: [Matplotlib-users] speed up imports?

2010-04-05 Thread Michael Droettboom
All of those calls to open are being generated from the pytz import -- which is why pytz seems like the likely candidate. Is it possible you have pytz installed as a compressed egg, or on a remote disk, or something that may be causing a file reading penalty? As Eric said, make sure you time

Re: [Matplotlib-users] speed up imports?

2010-04-05 Thread Eric Firing
Michael Droettboom wrote: All of those calls to open are being generated from the pytz import -- which is why pytz seems like the likely candidate. Is it possible you have pytz installed as a compressed egg, or on a remote disk, or something that may be causing a file reading penalty?

Re: [Matplotlib-users] speed up imports?

2010-04-02 Thread Michael Droettboom
My gut says it's probably the GUI framework import that is dominating the time. Which backend are you using? Does importing it take a large amount of time as well? Can you provide a profiler output file we can examine to narrow it down? The following from a command prompt should be

Re: [Matplotlib-users] speed up imports?

2010-04-02 Thread Gökhan Sever
On Fri, Apr 2, 2010 at 8:28 AM, Michael Droettboom md...@stsci.edu wrote: My gut says it's probably the GUI framework import that is dominating the time. Which backend are you using? Does importing it take a large amount of time as well? Can you provide a profiler output file we can

Re: [Matplotlib-users] speed up imports?

2010-04-02 Thread Michael Droettboom
Can you provide the actual saved profiler data? The output of the command itself doesn't provide enough information to diagnose the problem, since it doesn't have full file paths etc. When you do (thanks Gökhan for the less verbose version): python.exe -c import cProfile;

Re: [Matplotlib-users] speed up imports?

2010-04-02 Thread Michael Droettboom
It looks like most of the time is being taken up by pytz (timezone library), which opens ~500 files. How does the total time of import pytz compare? Mike Andrew Kelly wrote: I see. I was wondering why it spit out a binary file. test.out is attached... -Andy On Fri, Apr 2, 2010 at

Re: [Matplotlib-users] speed up imports?

2010-04-02 Thread Andrew Kelly
import pytz only took 0.0 seconds. I actually just ran that pstats module and there is one line that stuck out at me: ncalls tottime percall cumtime percall filename:lineno(function) 10.0000.0000.0000.000 C:\Python26\lib\os.py:35(_get_exports_list) 560

Re: [Matplotlib-users] speed up imports?

2010-04-02 Thread Eric Firing
Andrew Kelly wrote: import pytz only took 0.0 seconds. Sounds like it was already imported, so you were not really timing that import. On linux (ubuntu 9.10, Lenovo T60 laptop) importing pytz takes longer than importing numpy: efir...@manini:~$ time python -c import pytz real

[Matplotlib-users] speed up imports?

2010-04-01 Thread Andrew Kelly
Has anyone had any success in speeding up the mpl imports? import matplotlib.pyplot as plt ( or from matplotlib.figure import Figure) takes 6 full seconds to load. That seems excessive. Any ideas? -Andy -- Download

Re: [Matplotlib-users] speed up imports?

2010-04-01 Thread Friedrich Romstedt
Hmm, I wrote one time a lazy-import module, you create objects and use their attributes, but the object imports the module not earlier than the first attribute access. Thus these objects are used like the module via import module. I.e., module = Lazy('matplotlib.module'). There are also

Re: [Matplotlib-users] speed up imports?

2010-04-01 Thread Eric Firing
Andrew Kelly wrote: Has anyone had any success in speeding up the mpl imports? import matplotlib.pyplot as plt ( or from matplotlib.figure import Figure) takes 6 full seconds to load. That seems excessive. Any ideas? Unless you have a very old machine, it sounds like something is

Re: [Matplotlib-users] speed up imports?

2010-04-01 Thread Eric Firing
Andrew Kelly wrote: Has anyone had any success in speeding up the mpl imports? import matplotlib.pyplot as plt ( or from matplotlib.figure import Figure) takes 6 full seconds to load. That seems excessive. Any ideas? -Andy Andy, A couple replies came back directly to me (probably

Re: [Matplotlib-users] speed up imports?

2010-04-01 Thread Andrew Kelly
Eric, I am running it on a windows 7 machine and a windows XP machine. Odd that it does this only on win32. -Andy On Thu, Apr 1, 2010 at 4:17 PM, Eric Firing efir...@hawaii.edu wrote: Andrew Kelly wrote: Has anyone had any success in speeding up the mpl imports? import matplotlib.pyplot

Re: [Matplotlib-users] speed up imports?

2010-04-01 Thread C M
On Thu, Apr 1, 2010 at 7:17 PM, Eric Firing efir...@hawaii.edu wrote: Andrew Kelly wrote: Has anyone had any success in speeding up the mpl imports? import matplotlib.pyplot as plt ( or from matplotlib.figure import Figure) takes 6 full seconds to load.  That seems excessive.  Any ideas?

Re: [Matplotlib-users] speed up imports?

2010-04-01 Thread Gökhan Sever
On Thu, Apr 1, 2010 at 7:57 PM, C M cmpyt...@gmail.com wrote: On Thu, Apr 1, 2010 at 7:17 PM, Eric Firing efir...@hawaii.edu wrote: Andrew Kelly wrote: Has anyone had any success in speeding up the mpl imports? import matplotlib.pyplot as plt ( or from matplotlib.figure import Figure)