Slow on my OSX machine as well. I also get this strange warning which I
have never seen before (I usually only use MPL on my windows machine).
Warning (from warnings module):
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pytz/__init__.py",
line 29
from pkg_resources import resource_stream
UserWarning: Module numpy was already imported from
/Library/Frameworks/GDAL.framework/Versions/1.6/Python/site-packages/numpy/__init__.pyc,
but
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages
is being added to sys.path
On Fri, Apr 2, 2010 at 1:41 PM, Eric Firing <[email protected]> wrote:
> 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 0m0.203s
> user 0m0.144s
> sys 0m0.052s
> efir...@manini:~$ time python -c "import pylab"
>
> real 0m0.626s
> user 0m0.480s
> sys 0m0.124s
>
> efir...@manini:~$ time python -c "import numpy"
>
> real 0m0.113s
> user 0m0.088s
> sys 0m0.020s
>
> (Probably everything is in cache in these tests; repeats yielded similar
> results.)
>
> Eric
>
>
> 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)
>> 1 0.000 0.000 0.000 0.000
>> C:\Python26\lib\os.py:35(_get_exports_list)
>> 560 3.107 0.006 3.107 0.006 {open}
>> That is ~50% of the load time. I have 0 idea what this is though.
>> Let me try this on my os machine.....
>> -Andy
>>
>> On Fri, Apr 2, 2010 at 12:31 PM, Michael Droettboom <[email protected]<mailto:
>> [email protected]>> wrote:
>>
>> 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 10:55 AM, Michael Droettboom
>> <[email protected] <mailto:[email protected]>
>> <mailto:[email protected] <mailto:[email protected]>>> wrote:
>>
>> 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; cProfile.run('import pylab',
>> 'test.out')"
>>
>> this should produce a binary file "test.out" that can be loaded
>> with the pstats module and used by GUI tools such as KCacheGrind
>> to help us get to the bottom of this.
>>
>> Mike
>>
>> Andrew Kelly wrote:
>>
>> I'm back.
>>
>> My backend is wx. "Import wx" does not really take much
>> time
>> to import at all. In fact time.time() before and after =
>> 0.0
>>
>> Some computer details:
>> Processor: AMD Phenom IIx4 810 Processor 2.6 GHz
>> RAM: 8.00 GB
>>
>> As for the cProfiler output on pylab, I have attached the
>> output as test.txt.
>> -Andy
>>
>> On Fri, Apr 2, 2010 at 7:22 AM, Gökhan Sever
>> <[email protected] <mailto:[email protected]>
>> <mailto:[email protected] <mailto:[email protected]>>
>> <mailto:[email protected]
>> <mailto:[email protected]> <mailto:[email protected]
>> <mailto:[email protected]>>>>
>>
>> wrote:
>>
>>
>>
>> On Fri, Apr 2, 2010 at 8:28 AM, Michael Droettboom
>> <[email protected] <mailto:[email protected]>
>> <mailto:[email protected] <mailto:[email protected]>>
>> <mailto:[email protected] <mailto:[email protected]>
>> <mailto:[email protected] <mailto:[email protected]>>>> 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 examine
>> to narrow it
>> down? The following from a command prompt should be
>> sufficient to write
>> out a file called "import.prof":
>>
>> python.exe -c "import cProfile;
>> prof=cProfile.Profile();
>> prof.run('import pylab', 'import.prof')"
>>
>> Mike
>>
>>
>> Just for the records,
>>
>> It reads as:
>>
>> python -c "import cProfile; cProfile.run('import pylab',
>> filename='test.out')
>>
>> in Python 2.6.2
>>
>> These helped me to load the profile output:
>>
>> import pstats
>> stats = pstats.Stats("test.out")
>> stats.print_stats()
>>
>> -- Gökhan
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Download Intel® Parallel Studio Eval
>> Try the new software tools for yourself. Speed compiling,
>> find bugs
>> proactively, and fine-tune applications for parallel
>> performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> [email protected]
>> <mailto:[email protected]>
>> <mailto:[email protected]
>> <mailto:[email protected]>>
>> <mailto:[email protected]
>> <mailto:[email protected]>
>> <mailto:[email protected]
>> <mailto:[email protected]>>>
>>
>>
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>>
>> -- Michael Droettboom
>> Science Software Branch
>> Operations and Engineering Division
>> Space Telescope Science Institute
>> Operated by AURA for NASA
>>
>>
>>
>> -- Michael Droettboom
>> Science Software Branch
>> Operations and Engineering Division
>> Space Telescope Science Institute
>> Operated by AURA for NASA
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Download Intel® Parallel Studio Eval
>> Try the new software tools for yourself. Speed compiling, find bugs
>> proactively, and fine-tune applications for parallel performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users