Show pystone performance and CPU model name

Want something added? Ask for it here.
Post Reply
User avatar
sander
Release Testers
Release Testers
Posts: 8812
Joined: January 22nd, 2008, 2:22 pm

Show pystone performance and CPU model name

Post by sander »

Feature request: in SAB's debug logging, show the pystone performance

Pystone is a Python Dhrystone, and Dhrystone is "a synthetic computing benchmark program developed in 1984 by Reinhold P. Weicker intended to be representative of system (integer) programming." (source: https://en.wikipedia.org/wiki/Dhrystone)

Showing the Pystone performance will give an indication of the SAB, par2 and unrar performance you can expect, and an answer to questions like "why does XYZ take so long?".

On Linux, pystone is included in the Python install (for example: /usr/lib/python2.7/test/pystone.py). I don't know about OSX and Windows.

Code: Select all

$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:38) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import test.pystone
>>> int(test.pystone.pystones(1000)[1])
22353
>>> 
pystone is also available from http://svn.python.org/projects/python/t ... pystone.py

I've written some lines in SABnzbd.py, and the sabnzbd.log is now:

Code: Select all

2014-10-12 10:03:45,920::DEBUG::[SABnzbd:1283] My IPv4 address = 192.168.1.58
2014-10-12 10:03:45,951::DEBUG::[SABnzbd:1292] My IPv6 address = 2001:aaa::4ea1:ad57:5619
2014-10-12 10:03:46,016::DEBUG::[SABnzbd:1301] CPU Pystone available performance is 22977
2014-10-12 10:03:46,017::DEBUG::[SABnzbd:1306] CPU model name is Intel(R) Atom(TM) CPU N270   @ 1.60GHz
The "CPU model name" will only be printed if on Linux.

I'll do some more tests.


EDIT

On my Linux VPS:

Code: Select all

2014-10-12 12:38:26,478::DEBUG::[SABnzbd:1306] CPU Pystone available performance is 83028
2014-10-12 12:38:26,479::DEBUG::[SABnzbd:1310] CPU model name is Intel(R) Xeon(R) CPU           E5335  @ 2.00GHz
On Raspian Raspberry Pi:

Code: Select all

2014-10-12 12:44:32,128::DEBUG::[SABnzbd:1306] CPU Pystone available performance is 5555
2014-10-12 12:44:32,132::DEBUG::[SABnzbd:1310] CPU model name is ARMv6-compatible processor rev 7 (v6l)
My i3 Core:

Code: Select all

2014-10-12 19:58:59,553::DEBUG::[SABnzbd:1306] CPU Pystone available performance is 78486
2014-10-12 19:58:59,554::DEBUG::[SABnzbd:1310] CPU model name is Intel(R) Core(TM) i3 CPU       M 370  @ 2.40GHz
My Cubox:

Code: Select all

2014-10-17 23:10:17,945::DEBUG::[SABnzbd:1306] CPU Pystone available performance is 16666
2014-10-17 23:10:17,947::DEBUG::[SABnzbd:1310] CPU model name is ARMv7 Processor rev 10 (v7l)
EDIT 2:

Code on my github:
https://github.com/sanderjo/sabnzbd/com ... 87f7f04142
User avatar
sander
Release Testers
Release Testers
Posts: 8812
Joined: January 22nd, 2008, 2:22 pm

Re: Show pystone performance and CPU model name

Post by sander »

If you want to test the git version yourself:

Stop SABnzbd. Then

Code: Select all

cd
mkdir git-oct17
cd git-oct17/
git clone https://github.com/sanderjo/sabnzbd.git
cd sabnzbd/
git checkout 0.7.x
./SABnzbd.py 
Set logging to DEBUG
Restart SABnzbd

You should then see the logging, for example like this:

Code: Select all

$ grep -i -e pystone -e cpu ~/.sabnzbd/logs/sabnzbd.log
2014-10-17 23:03:55,443::DEBUG::[SABnzbd:1306] CPU Pystone available performance is 80444
2014-10-17 23:03:55,444::DEBUG::[SABnzbd:1310] CPU model name is Intel(R) Xeon(R) CPU           E5335  @ 2.00GHz
HTH
zoggy
Release Testers
Release Testers
Posts: 75
Joined: February 8th, 2011, 3:08 pm

Re: Show pystone performance and CPU model name

Post by zoggy »

tried your 0.7.x branch, this is what I see:

Code: Select all

>grep -i -e pystone -e cpu sabnzbd.log
2014-10-19 18:43:15,209::DEBUG::[SABnzbd:1306] CPU Pystone available performance is 65834
not sure the context of providing some random # to people..
also seems like you should be using pystone to compare python compilers/versions. since this isnt profiling any actual sab code.. just runs its own little test to see how long it took to process its little test..

http://stackoverflow.com/questions/2091 ... s-machines

Code: Select all

Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from test import pystone
>>> pystone.main()
Pystone(1.1) time for 50000 passes = 0.735539
This machine benchmarks at 67977.4 pystones/second
interesting to note:
https://ironpython.codeplex.com/wikipag ... VsIP20Perf

but anyways, im not saying having some pystone metric to view across all the users (if you knew their os / python version / cpu info) wouldnt be bad.. as then one could see.. oh look python 2.5 or ironpython or apple's python sucks far more than x. thus we could recommend others to upgrade/change what interrupter to use. but anyways then your taking into asking users to submit info or we pull it automatically (with opt out). but honestly i see this is little gain since most of the time the issue with peoples machines and sab is that they have low cpu or not have yenc installed.
User avatar
sander
Release Testers
Release Testers
Posts: 8812
Joined: January 22nd, 2008, 2:22 pm

Re: Show pystone performance and CPU model name

Post by sander »

Main goal is to show performance of the CPU, which is an indication for the performance of SAB and especially par2 and unrar. It's not profiling.

Underlying motivation: Running SAB on a NAS with an ARM CPU will give quite a different download/unpack experience than running it on an Intel Core system. So the Pystone performance will answer questions like "why is SAB on my NAS slower than on my Windows PC?"
zoggy
Release Testers
Release Testers
Posts: 75
Joined: February 8th, 2011, 3:08 pm

Re: Show pystone performance and CPU model name

Post by zoggy »

well cpu spec is just one factor.. a big deal is that on 'windows' we are prob are providing the binary hence we provide yenc while the arm install the user isnt forced to install any of the dependencies.. ssl/yenc/etc. its just like why i always hear about why nzbget is so much better than sab... just blindly quoting about C++ is faster than python. regardless of the fact that they both are using par/unrar/yenc to do the heavy lifting.. thus the amount of c vs python code is moot... the only time that really comes into play is when c based yenc isnt installed and python has to do it all.. then cpu really becomes the limiting factor.. and then there is just crap setups when people set their download drive to the same drive that extracts and you get hd thrashing galore
Post Reply