Page 1 of 1

namebench

Posted: 18. Aug 2010, 09:04
by pwatk
Interesting DNS server benchmarking tool based on python. There is a GUI but I'm happy with the commandline interface. depfinder also lists the python socks and python System modules as dependencies but this didn't seam to affect anything (I'm not big on python so someone update me if I'm wrong).

FTP link: namebench

Re: namebench

Posted: 18. Aug 2010, 10:43
by laprjns
Since this is a python apps,shouldn't the arch be set to noarch? Anyway it works. Here's my results:
http://namebench.appspot.com/id/1027014

Re: namebench

Posted: 18. Aug 2010, 11:47
by thenktor
laprjns wrote:Since this is a python apps,shouldn't the arch be set to noarch? Anyway it works. Here's my results:
http://namebench.appspot.com/id/1027014
Python apps usually are compiled to some bytecode. I don't think it is arch independent. Can someone else clarify this?

Re: namebench

Posted: 18. Aug 2010, 11:57
by damNageHack
thenktor wrote:Python apps usually are compiled to some bytecode. I don't think it is arch independent. Can someone else clarify this?
PYC -> Compiled python bytecode, arch independent (as far as i can understand)
PYO -> Optimized, assert statements removed
A program doesn't run any faster when it is read from a ‘.pyc’ or ‘.pyo’ file than when it is read from a ‘.py’ file; the only thing that's faster about ‘.pyc’ or ‘.pyo’ files is the speed with which they are loaded.
http://www.network-theory.co.uk/docs/py ... files.html

But be aware of the depending site-packages, often depending on binary compiled .so libraries (arche-dependent!) or installing as site-packages themselfs. Good example: Miro or translate-toolkit

Read also this: http://bytes.com/topic/python/answers/2 ... ndependent

Re: namebench

Posted: 18. Aug 2010, 18:16
by pwatk
Oops that it is a mistake, I meant to put noarch.

This line makes sure everything is installed into the correct site-packages directory for the current system's architecture:

Code: Select all

pythonlib=$( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" )
Edit: if I was submitting this for inclusion to the Salix repository I'd probably change this approach.

Re: namebench

Posted: 18. Aug 2010, 18:37
by pwatk
On second thoughts I've updated the script to take in to account any eventuality ;).

Re: namebench

Posted: 19. Aug 2010, 14:35
by damNageHack
pwatk wrote:

Code: Select all

pythonlib=$( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" )
Edit: if I was submitting this for inclusion to the Salix repository I'd probably change this approach.
Oh, thanks for your hint with the one-line code :)
But unfortunately, this would not solve the problem of arch-dependent binary compiled libraries(*.so) in the site-packages folder. It is better to have different packages each with a specific arch sign in its name to get clarified that issue.

Re: namebench

Posted: 19. Aug 2010, 17:16
by pwatk
damNageHack wrote:
pwatk wrote:

Code: Select all

pythonlib=$( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" )
Edit: if I was submitting this for inclusion to the Salix repository I'd probably change this approach.
Oh, thanks for your hint with the one-line code :)
But unfortunately, this would not solve the problem of arch-dependent binary compiled libraries(*.so) in the site-packages folder. It is better to have different packages each with a specific arch sign in its name to get clarified that issue.
I stole the one-liner from a script by Eric Hameleers (Alien Bob) :).

I added this to the script last night to tag the package and address the lib arch dependencies:

Code: Select all

arch=$(uname -m)
Although this will tag the package as i686 for most systems it's simpler than this (my first idea):

Code: Select all

...
pythonver=$( python -c "from distutils.sysconfig import get_python_version; print get_python_version()" )
case "$arch" in
  i[3-6]86)
    pythonlib="/usr/lib/python$pythonver/site-packages/"
    ;;
  x86_64)
    pythonlib="/usr/lib64/python$pythonver/site-packages/"
    ;;
  *)
    pythonlib=$( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" )
    ;;
esac
...
There has got to be a way of displaying the system (libc) architecture without resorting to such vague actions as this:

Code: Select all

ls /usr | grep -E "i486|x86_64" | cut -f 1 -d -

Re: namebench

Posted: 19. Aug 2010, 18:53
by damNageHack
You know that the parameter arch is optional in SLKBUILD? slkbuild can detect it by itself with help from the host system, see man page.

Re: namebench

Posted: 20. Aug 2010, 11:10
by pwatk
I obviously missed that one. Thanks.