librelist archives

« back to archive

Puzzling results from run-test.py

Puzzling results from run-test.py

From:
Abdul Bijur V A
Date:
2012-07-08 @ 21:04
could not decode message

Re: [flask] Puzzling results from run-test.py

From:
Christoph Heer
Date:
2012-07-08 @ 21:10
Hi Abdul,

this is very interesting. Can you show us more about the tests like
some code or what it's testing? Which other dependencies you have?

Regards,
Christoph


2012/7/8 Abdul Bijur V A <bijur@grep-i.com>:
> Dear all,
>
> I was just upgrading to Flask-0.9 on my local development machine and a
> dummy test server on rackspace and found that teh machine on rackspace
> executed the run-test.py much faster than my local dev machine. here is the
> stat:
>
> Local Dev machine:
>
> Core i7 2.2 Ghz (8 effective cores), 8 GB RAM - Ubuntu 12.04
>
> glam@glamBox:~/setup/Flask-0.9$ python run-tests.py
> 
................................................................................................................................................................................................
> ----------------------------------------------------------------------
> Ran 192 tests in 3.620s
>
>
> Online Server:
>
> 1/64th of a Intel Xeon processor core, 256 MB Ram , Ubuntu 10.04
>
> glam@grep-i:~/hack/Flask-0.9$ python run-tests.py
> 
...................................................................................................................................................................................................
> ----------------------------------------------------------------------
> Ran 195 tests in 0.791s
>
>
> What am i missing? Or why is this??
>
> Regards,
> Abdul Bijur

Re: [flask] Puzzling results from run-test.py

From:
Abdul Bijur V A
Date:
2012-07-08 @ 21:20
Hi,

I am executing the "run-tests.py" that comes packaged in the Flask-0.9
http://pypi.python.org/packages/source/F/Flask/Flask-0.9.tar.gz package.

I didn't really look further into the tests that were being run.

I am guessing RAM doesn't affect here, and CPU cores are not being used
as python was probably running in a single thread and Xeon > Core i7,
hence the result?

Does sound incredibly unfair ;)

Regards,
Abdul

On 07/08/2012 11:10 PM, Christoph Heer wrote:
> Hi Abdul,
>
> this is very interesting. Can you show us more about the tests like
> some code or what it's testing? Which other dependencies you have?
>
> Regards,
> Christoph
>
>
> 2012/7/8 Abdul Bijur V A <bijur@grep-i.com>:
>> Dear all,
>>
>> I was just upgrading to Flask-0.9 on my local development machine and a
>> dummy test server on rackspace and found that teh machine on rackspace
>> executed the run-test.py much faster than my local dev machine. here is the
>> stat:
>>
>> Local Dev machine:
>>
>> Core i7 2.2 Ghz (8 effective cores), 8 GB RAM - Ubuntu 12.04
>>
>> glam@glamBox:~/setup/Flask-0.9$ python run-tests.py
>> 
................................................................................................................................................................................................
>> ----------------------------------------------------------------------
>> Ran 192 tests in 3.620s
>>
>>
>> Online Server:
>>
>> 1/64th of a Intel Xeon processor core, 256 MB Ram , Ubuntu 10.04
>>
>> glam@grep-i:~/hack/Flask-0.9$ python run-tests.py
>> 
...................................................................................................................................................................................................
>> ----------------------------------------------------------------------
>> Ran 195 tests in 0.791s
>>
>>
>> What am i missing? Or why is this??
>>
>> Regards,
>> Abdul Bijur
>


Re: [flask] Puzzling results from run-test.py

From:
Christoph Heer
Date:
2012-07-08 @ 21:25
Sorry that I misunderstood you. I thought you are testing your flask
application.
That the Flask testsuite is so much faster on the server is maybe the
faster CPU but I amn't sure.

Regards,
Christoph

2012/7/8 Abdul Bijur V A <bijur@grep-i.com>:
> Hi,
>
> I am executing the "run-tests.py" that comes packaged in the Flask-0.9
> http://pypi.python.org/packages/source/F/Flask/Flask-0.9.tar.gz package.
>
> I didn't really look further into the tests that were being run.
>
> I am guessing RAM doesn't affect here, and CPU cores are not being used
> as python was probably running in a single thread and Xeon > Core i7,
> hence the result?
>
> Does sound incredibly unfair ;)
>
> Regards,
> Abdul
>
> On 07/08/2012 11:10 PM, Christoph Heer wrote:
>> Hi Abdul,
>>
>> this is very interesting. Can you show us more about the tests like
>> some code or what it's testing? Which other dependencies you have?
>>
>> Regards,
>> Christoph
>>
>>
>> 2012/7/8 Abdul Bijur V A <bijur@grep-i.com>:
>>> Dear all,
>>>
>>> I was just upgrading to Flask-0.9 on my local development machine and a
>>> dummy test server on rackspace and found that teh machine on rackspace
>>> executed the run-test.py much faster than my local dev machine. here is the
>>> stat:
>>>
>>> Local Dev machine:
>>>
>>> Core i7 2.2 Ghz (8 effective cores), 8 GB RAM - Ubuntu 12.04
>>>
>>> glam@glamBox:~/setup/Flask-0.9$ python run-tests.py
>>> 
................................................................................................................................................................................................
>>> ----------------------------------------------------------------------
>>> Ran 192 tests in 3.620s
>>>
>>>
>>> Online Server:
>>>
>>> 1/64th of a Intel Xeon processor core, 256 MB Ram , Ubuntu 10.04
>>>
>>> glam@grep-i:~/hack/Flask-0.9$ python run-tests.py
>>> 
...................................................................................................................................................................................................
>>> ----------------------------------------------------------------------
>>> Ran 195 tests in 0.791s
>>>
>>>
>>> What am i missing? Or why is this??
>>>
>>> Regards,
>>> Abdul Bijur
>>
>
>
>

Re: [flask] Puzzling results from run-test.py

From:
Simon Sapin
Date:
2012-07-09 @ 05:40
Le 08/07/2012 23:04, Abdul Bijur V A a écrit :
> I was just upgrading to Flask-0.9 on my local development machine and a
> dummy test server on rackspace and found that teh machine on rackspace
> executed the run-test.py much faster than my local dev machine. here is
> the stat:

Hi,

Try this:  time python python run-tests.py

The 'time' command reports several times. 'real' is what you could 
measure with a stopwatch. 'user' is the time spent running code on the 
CPU. It can be more than 'real' if you’re using multiple threads, or 
less if your program is waiting of I/O a lot. 'sys' is the time spent in 
the kernel and is usually small.

This can tell you is the time it takes to run the tests is mostly CPU or 
mostly I/O.

Also, try running it a few times and pick the smallest. Python reads 
quite a few files on start-up and having these in cache helps.

If you’re interested in what parts of the Python code takes more time, 
use the cProfile module. The "default" visualization of the results is 
in textual tables with the pstats module, but gprof2dot together with 
xdot can show you colored graphs that I find much easier to read.

Note that profiling has some overhead. (The program will be slower.) So 
don’t compare a profiled and an non-profiled run, but comparing two 
profiled runs is okay.

http://docs.python.org/library/profile.html
http://code.google.com/p/jrfonseca/wiki/Gprof2Dot
http://code.google.com/p/jrfonseca/wiki/XDot

Happy profiling,
-- 
Simon Sapin