Re: Richards bench benchmark

Discussion in 'Python' started by Peter Hansen, Apr 2, 2004.

  1. Peter Hansen

    Peter Hansen Guest

    Duncan Lissett wrote:
    > Peter Hansen wrote:
    >>I'd implement it in Python for kicks, but I'm not sure how I'd know
    >>whether my version was doing the right thing. Are there any tests
    >>for it? Ways of ensuring the output is correct?

    >
    > Martin Richards original spec and debug/trace information is reposted
    > here:
    > http://www.lissett.com/ben/com/benchspec.htm


    Okay, as a starting point I've turned the "gold output" part of that
    spec into a first acceptance test, and have a shell bench.py which
    runs but fails ('pass' statements tend to do that a lot during TDD).

    The code should be available with

    svn co svn://fortress.engcorp.com/public/bench

    I don't really expect anyone to check it out at this stage, but if you
    happen to have a free moment, I wouldn't mind knowing if subversion
    is properly visible through my firewall.

    -Peter
     
    Peter Hansen, Apr 2, 2004
    #1
    1. Advertising

  2. Peter Hansen <> wrote in message news:<>...

    > The code should be available with
    >
    > svn co svn://fortress.engcorp.com/public/bench
    >
    > I don't really expect anyone to check it out at this stage, but if you
    > happen to have a free moment, I wouldn't mind knowing if subversion
    > is properly visible through my firewall.


    What do we use to browse that?
     
    Duncan Lissett, Apr 6, 2004
    #2
    1. Advertising

  3. Peter Hansen

    Peter Hansen Guest

    Duncan Lissett wrote:
    > Peter Hansen <> wrote in message news:<>...
    >
    >
    >>The code should be available with
    >>
    >> svn co svn://fortress.engcorp.com/public/bench
    >>
    >>I don't really expect anyone to check it out at this stage, but if you
    >>happen to have a free moment, I wouldn't mind knowing if subversion
    >>is properly visible through my firewall.

    >
    >
    > What do we use to browse that?


    Subversion, the replacement for CVS. See http://subversion.tigris.org/
    for a start, and grab the command line version for whatever OS
    you are using and after an appropriate installation, the above command
    should grab the source into the "public/bench" folder under your current
    directory. There's also TortoiseSVN (integrated with Win Explorer
    shell) or RapidSVN from the same place.

    -Peter
     
    Peter Hansen, Apr 6, 2004
    #3
  4. Duncan Lissett, Apr 21, 2004
    #4
  5. Peter Hansen

    Peter Hansen Guest

    Duncan Lissett wrote:

    > Peter Hansen <> wrote in message news:<>...
    >
    > Done some interpreter implementations, so Python won't look out of place ;-)
    >
    > http://www.lissett.com/ben/bench1.htm


    Okay, first working version is available by going to
    http://www.engcorp.com/main/projects/PyBench .

    That's about all the time I can spare on this for now.
    Feel free to download, hack, improve, or ignore.

    If nothing else, it would be of some interest to have
    someone run one of the other versions on a common machine
    and post the results. The above page is a wiki, so feel
    free to add results there, expand the page, whatever...

    -Peter
     
    Peter Hansen, Apr 23, 2004
    #5
  6. Peter Hansen <> wrote in message news:<>...

    > Okay, first working version is available by going to
    > http://www.engcorp.com/main/projects/PyBench .
    >
    > That's about all the time I can spare on this for now.
    > Feel free to download, hack, improve, or ignore.


    Excellent!

    I've added the Python implementation timings:
    http://www.lissett.com/ben/bench1.htm

    I've no prior experience of Python to judge from, but for some reason
    I expected it to be faster than the interpreted implementation of
    Smalltalk designed for mobile devices.
     
    Duncan Lissett, Apr 25, 2004
    #6
  7. Peter Hansen

    Peter Hansen Guest

    Duncan Lissett wrote:

    > Peter Hansen <> wrote in message news:<>...
    >
    >>Okay, first working version is available by going to
    >>http://www.engcorp.com/main/projects/PyBench .
    >>
    >>That's about all the time I can spare on this for now.
    >>Feel free to download, hack, improve, or ignore.

    >
    > Excellent!
    >
    > I've added the Python implementation timings:
    > http://www.lissett.com/ben/bench1.htm
    >
    > I've no prior experience of Python to judge from, but for some reason
    > I expected it to be faster than the interpreted implementation of
    > Smalltalk designed for mobile devices.


    One key item would be to examine the function calls to append().
    I'm guessing they are a substantial portion of the execution
    time. A little profiling is in order if anyone is interested
    in optimizing it.

    I made no effort to convert it to a Pythonic style. It's
    basically C code translated, with one small exception being
    the task list which is a simple Python list object instead of
    being a linked list. That means task lookups by id using findtcb()
    are quite fast, but the "work queues" used to hold the packets
    are actual singly-linked lists, implemented in Python, with
    a subroutine called append() used to scan the list and stick
    stuff on the end. This is absolutely, without question, not
    the way anyone would write this in Python if they were not
    just trying to maintain the original BCPL/C flavour intact.

    I'll make a prediction: with an hour or two of work, any
    good Python programmer can get a 10x speedup out of the
    program. I don't know how meaningful it will be as a
    benchmark at that point, but it is probably fair to compare
    with the object-oriented versions which already violate the
    original specification (e.g. the Java version, and the
    Smalltalk ones Duncan mentioned).

    If anyone wants to improve it, feel free. There are full
    unit tests and an acceptance test in bench_test.py, even
    covering the format of the output, so this could be a good
    chance for someone new to unit testing to get a feel for
    it by trying to modify them to drive the code in a new
    direction...

    -Peter
     
    Peter Hansen, Apr 25, 2004
    #7
  8. Peter Hansen <> wrote in message news:<>...
    > http://www.engcorp.com/main/projects/PyBench .
    > The above page is a wiki ...


    <remark having nothing to do with the original question>

    I see that you use ZWiki; I started using it few days ago
    and I like it. My question: did you succeed in getting
    the testing framework (http://www.zwiki.org/FitTests) to work?
    It seems it is very new and it does not work out of the box,
    at least for me. Alternatively, which Web-based test framework
    (Fitnless-like) would you suggest for Python?

    The question is of course open to everybody having expertise
    in the area.
    </remark having nothing to do with the original question>

    Michele Simionato
     
    Michele Simionato, Apr 25, 2004
    #8
  9. Peter Hansen

    Peter Hansen Guest

    ZWiki and FitTests (was Re: Richards bench benchmark)

    Michele Simionato wrote:

    > Peter Hansen <> wrote in message news:<>...
    >
    >>http://www.engcorp.com/main/projects/PyBench .
    >> The above page is a wiki ...

    >
    > <remark having nothing to do with the original question>
    >
    > I see that you use ZWiki; I started using it few days ago
    > and I like it. My question: did you succeed in getting
    > the testing framework (http://www.zwiki.org/FitTests) to work?
    > It seems it is very new and it does not work out of the box,
    > at least for me. Alternatively, which Web-based test framework
    > (Fitnless-like) would you suggest for Python?
    >
    > The question is of course open to everybody having expertise
    > in the area.
    > </remark having nothing to do with the original question>


    I use ZWiki because four years ago when we tried to set up an
    Intranet at Kaval, we got Zope and ZWiki working very easily
    with little effort.

    Then we tried to build on that, and improve things, and write
    our own products, and we encountered what seemed like a very
    tall and steep learning curve with Zope. We never got a whole
    lot further with it, but it remains for me one of the simplest
    combinations of things available to get a wiki set up
    quickly (i.e. a couple of minutes of work, post installation).

    You'll notice, perhaps, that I'm using a fairly old version
    of ZWiki. I'm loath to update, at this point, partly because
    "it's working" and partly because I try to make as few changes
    as possible to anything we do with Zope, including attempting
    to figure out how to get the "new" testing framework working.
    (I say "new" because of course I'm now way behind the times
    in this area and most others of Zope.) I'm not particularly
    surprised to hear that you didn't get it working yourself.

    -Peter
     
    Peter Hansen, Apr 25, 2004
    #9
  10. Re: ZWiki and FitTests (was Re: Richards bench benchmark)

    Peter Hansen <> wrote in message news:<>...
    > I use ZWiki because four years ago when we tried to set up an
    > Intranet at Kaval, we got Zope and ZWiki working very easily
    > with little effort.
    >
    > Then we tried to build on that, and improve things, and write
    > our own products, and we encountered what seemed like a very
    > tall and steep learning curve with Zope. We never got a whole
    > lot further with it, but it remains for me one of the simplest
    > combinations of things available to get a wiki set up
    > quickly (i.e. a couple of minutes of work, post installation).
    >
    > You'll notice, perhaps, that I'm using a fairly old version
    > of ZWiki. I'm loath to update, at this point, partly because
    > "it's working" and partly because I try to make as few changes
    > as possible to anything we do with Zope, including attempting
    > to figure out how to get the "new" testing framework working.
    > (I say "new" because of course I'm now way behind the times
    > in this area and most others of Zope.) I'm not particularly
    > surprised to hear that you didn't get it working yourself.
    >
    > -Peter


    Well, so far my experience with Zope closely match yours; that's why
    I asked here before trying touching anything ;) So, what about my
    second question, i.e. other fit tests for Python?


    Michele Simionato
     
    Michele Simionato, Apr 26, 2004
    #10
  11. Peter Hansen <> wrote in message news:<>...

    -snip-
    > I'll make a prediction: with an hour or two of work, any
    > good Python programmer can get a 10x speedup out of the
    > program. I don't know how meaningful it will be as a
    > benchmark at that point, but it is probably fair to compare
    > with the object-oriented versions which already violate the
    > original specification (e.g. the Java version, and the
    > Smalltalk ones Duncan mentioned).


    There are now separate pages for the Richards implementations that
    stick to the spec, and for the object-oriented variant.
    So the other languages shown with Python are solving the same problem
    in the same way.

    http://www.lissett.com/ben/bench3.htm
     
    Duncan Lissett, May 7, 2004
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joseph A. Zammit

    Xilinx test bench and user group

    Joseph A. Zammit, Feb 25, 2004, in forum: VHDL
    Replies:
    3
    Views:
    2,186
  2. Pete Fraser
    Replies:
    4
    Views:
    6,963
    Mike Treseler
    Nov 4, 2004
  3. Duncan Lissett

    make faster Richards benchmark

    Duncan Lissett, May 13, 2004, in forum: Python
    Replies:
    15
    Views:
    805
    Duncan Lissett
    May 14, 2004
  4. Simon Wittber

    RE: make faster Richards benchmark

    Simon Wittber, May 14, 2004, in forum: Python
    Replies:
    4
    Views:
    314
    Duncan Lissett
    May 17, 2004
  5. Duncan Lissett

    make faster Richards benchmark

    Duncan Lissett, May 24, 2004, in forum: Ruby
    Replies:
    11
    Views:
    257
    Duncan Lissett
    Jun 1, 2004
Loading...

Share This Page