make faster Richards benchmark

Jack Diederich jack at performancedrivers.com
Thu May 13 13:17:31 EDT 2004


On Thu, May 13, 2004 at 09:15:58AM -0700, Duncan Lissett wrote:
> Duncan Booth <me at privacy.net> wrote in message news:<Xns94E8683D9EEF2duncanrcpcouk at 127.0.0.1>...
> > Remove the pointless set/get methods and just access the members directly. 
> > If you are writing a benchmark they will cripple performance.
> > 
> > Avoiding multiple accesses to the same instance variable, or assigning to 
> > instance variables until you are about to return from a method: use a local 
> > during the execution of the method.
> 
> The pointless set/get methods are pointless in the other language
> implementations as well - that's the point. (And I'll cripple that
> Oberon-2 implementation real soon by enforcing privacy with modules
> and set/get procedures.)

I would leave python and some other languages out of the comparison.
You can do near line-for-line translations for languages in the same class
- say C++ and Java, or Assembly and C.  Requiring the python/perl/ruby
versions to look like a C++ program just measures how badly C++ maps to 
Python, and not much else.

I've even seen some line-for-line translations in production use that
use python list-of-strings where the orignal version used char arrarys.
You can imagine what that does for performance *shudder*.

Writing benchmarks is just hard, if you allow people to solve the problem
in whatever way they like you end up measuring how good a coder the
language A guy is compared to the language B submitter.

-jackdied







More information about the Python-list mailing list