[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C and Smalltalk; speed of message send

From: Richard Frith-Macdonald
Subject: Re: Objective-C and Smalltalk; speed of message send
Date: Sun, 8 Aug 2004 08:28:05 +0100

A few additional observations ...

People think writing a benchmark is easy ... the task appears very simple ... in fact it's very easy to get things badly wrong.

Benchmarks between different languages are worse ... the languages will be designed to do things in different ways and will be better at some things than other so that, even where you find seemingly perfect matches for control constucts etc, the performances may differ markedly, yet because the languages are used differently, this may not reflect the overall performance of real world code.

The C family of languages is used with iterative and procedural algorithms ... mostly the compiler does not attempt to recognize or optimise recursive code.

Other languages are more designed for recursive algorithms and a good compiler for one of these languages will optimise recursive function/method operations to avoid call overheads.

Objective-C is C with objects ... intended to be written as such with objects mostly being relatively large complex beasts in in which a method will do a lot of work and any message send overheads are therefore dwarfed by the cost of the work actually done in the method.

So for a 'fair' test of calculating fibonnacci numbers in Smalltalk and ObjC, the Smalltalk might use a recursive algorithm while the ObjC code mightbe a method encapsulating an interative algorithm.

Of course, then the complaint is raised that we are not comparing like with like because we are using different algorithms.

IMO it's therefore pretty impossible to compare language performance with simple benchmarks, as one side or the other will always complain that the test isn't fair, and both sides will be right.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]