[Matplotlib-devel] import time doubled by master vs 1.4.3

Nathaniel Smith njs at pobox.com
Tue Sep 8 22:51:37 CEST 2015


"User" and "system" time are both measures of cpu time. Disk access shows
up in the difference between real - (user + sys). (Also disk access time is
never going to be measurable for a smallish read only workload like this
after the first time you run it, because the OS will cache everything in
RAM. If you want to measure disk access time then you need to drop caches
before each test. In the VM case I guess you might need to do this on both
the guest and host.)

Anyway a 300 ms difference in cpu time is pretty blatant, I'd just run it
under a profiler and see what pops up.

-n
On Sep 8, 2015 1:42 PM, "Eric Firing" <efiring at hawaii.edu> wrote:

> On 2015/09/08 9:51 AM, Thomas Caswell wrote:
>
>> My guess is that this has to do with disk access?  With venvs running on
>> a ramdisk I get almost identical times, particularly if I run it a
>> couple of times:
>>
>> 15:39$ time python -c "from matplotlib import pyplot; import matplotlib;
>> print(matplotlib.__version__)"
>> 1.4.3
>>
>> real    0m0.377s
>> user    0m0.343s
>> sys     0m0.030s
>>
>> 15:36$ time python -c "from matplotlib import pyplot; import matplotlib;
>> print(matplotlib.__version__)"
>> 1.5.dev1
>>
>> real    0m0.362s
>> user    0m0.327s
>> sys     0m0.030s
>>
>> Both of those times fluctuate and despite what I pasted, 1.4.3 seems to
>> be faster more often than not (but by hundredths of seconds).
>>
>> Running this command several times seems the later runs seem to be
>> faster than the first time.
>>
>
> Running multiple times one does see variations, but not large ones
> compared to the factor of two I am getting between the versions.  My
> environment is a virtualenv in a VMWare linux VM on a Mac, with the disk
> access via VMWare's hgfs.  The Mac has SSD, so the physical disk access is
> quick; and at least some things will be retrieved from cache on multiple
> runs. The tests were made using the same VM and the same virtualenv, so the
> only thing that changed was whether I had just build mpl from 1.4.3 or from
> master.
>
> Now I have tried the experiment on the OSX side, and I get very similar
> results, except that all the times are a little bit longer than on the
> linux VM:
>
>
> (python3)efiring at manini2:~/work/programs/py/ladcp_netcdf$ time python -c
> "from matplotlib import pyplot; import matplotlib;
> print(matplotlib.__version__)"
> 1.4.3
>
> real    0m0.379s
> user    0m0.321s
> sys     0m0.055s
>
> (testmpl3)efiring at manini2:~/work/programs/py/mpl/matplotlib$ time python
> -c "from matplotlib import pyplot; import matplotlib;
> print(matplotlib.__version__)"
> 1.5.dev1
>
> real    0m0.795s
> user    0m0.704s
> sys     0m0.086s
>
> I guess the fact that the linux VM on OSX is faster than native OSX points
> to disk access in some form--maybe there is more caching on the linux
> side--but the puzzle remains: why the factor of two difference between
> 1.4.3 and master in these two reasonably normal configurations?
>
> Eric
>
>
>
>> Tom
>>
>> On Tue, Sep 8, 2015 at 3:30 PM Eric Firing <efiring at hawaii.edu
>> <mailto:efiring at hawaii.edu>> wrote:
>>
>>     test:
>>
>>     time python -c "from matplotlib import pyplot"
>>
>>     On a linux VM with Py 3.4 the user time is around
>>
>>     0.25 s for 1.4.3
>>     0.5 s for master
>>
>>     That's quite a difference.  Can anyone else reproduce this?  Any ideas
>>     as to what is causing the slowdown?
>>
>>     In both tests the backend was tkagg, so the difference was not a
>> matter
>>     of importing different gui toolkits.
>>
>>     Eric
>>     _______________________________________________
>>     Matplotlib-devel mailing list
>>     Matplotlib-devel at python.org <mailto:Matplotlib-devel at python.org>
>>     https://mail.python.org/mailman/listinfo/matplotlib-devel
>>
>>
> _______________________________________________
> Matplotlib-devel mailing list
> Matplotlib-devel at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20150908/b064e1ac/attachment-0001.html>


More information about the Matplotlib-devel mailing list