discuss-gnustep
[Top][All Lists]
Advanced

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

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


From: Lyndon Tremblay
Subject: Re: Objective-C and Smalltalk; speed of message send
Date: Sun, 08 Aug 2004 19:33:43 +0800



> 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.
>

If I am considered also a People, I will defend the choice of using term
'benchmark' as highly inappropriate; written in haste within a vacuum of
mistrust on the "results". "Message send comparison" - I have motives for
comparing Objective-C and Smalltalk like this; this and its technology will
appear before us sometime in the future.

 > 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.
>

 Languages have no use unless used. They can be chosen to be used
differently, Eg. I could very well use Objective-C as I would Smalltalk, if
we pretend we have blocks and all literals as objects as well, and a
complimentary foundation library. So, the language describes the use of
itself and implementation of its uses - by its performance, encouragement of
design and habit by syntax and even abilities, etc etc.

 Anyways, it is quite unfair. Thank you for bringing to light the fault of
this 'fib' test, I did not realise any unreliability would affect *relative*
performance. It was merely ported straight from Squeak, "testing whatever
numbers it tested". And some numbers ended up smaller than others, isn't
that the point? Comparing numbers, as long as they were implementated
equally as languages would allow, they are considered "the same code, in a
different language".

 > 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.
>

 Makes sense, including the design of frameworks for each regarding language
foundation library.

 > 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.
>

 Yes, thank you for your input.

 --Lyndon






reply via email to

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