C is fastest (was: McMaster University Creates Open Source eHealth Records System)

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Wed Oct 14 13:55:58 UTC 2009


On Tue, Oct 13, 2009 at 11:49:18PM -0400, Yanni Chiu wrote:
> When I read the original comment, I assumed that "efficient language"
> meant efficient use of the developer's time. I'm surprised (but I
> shouldn't be) that people still want to talk about "code written in
> language A, runs faster than if written in language B).

Some of us don't like seeing perfectly good hardware being wasted by
lazy ass idiot programmers.

Also some of us work on embedded hardware and really hate wasting CPU
on stupid languages.

Saving developer time is highly overrated.  How about the time of the
tester you waste, the resources of customers you waste, etc.

> As to runtime efficiency, the Sun Java HotSpotVM technology is derived  
> from the Animorphic VM built for Smalltalk, which was bought by Sun. At  
> runtime, the VM chooses "hot" methods to compile its bytecodes into  
> native machine code, and caches the compiled machine code for subsequent  
> invocations. And, this still works for polymorphic invocations (i.e. the  
> calling code doesn't know the exact class in the hierarchy of the object  
> being invoked). This will execute faster than any C++ compiler that uses  
> vtables.

I don't like C++ either for the same reason.  C++ only gets decent
performance when you avoid that stuff.

> I'll also contend that, except for very short programs, a system written  
> in Smalltalk or Java, running with Animorphic VM ideas, could run faster  
> than a well written C version. There are two reasons. One, once a  
> program gets big enough, you need to do memory mgmt, and the VM's  
> garbage collection would probably do a better job than ad hoc code. Two,  
> the VM optimizations are discovered and applied at runtime, and it will  
> find optimizations that developers could not have imagined, when looking 
> at a small bit of code -- i.e. like what happens when the global  
> optimization switch is used for a C compiler.

Java's garbage collection has always been amazingly bad.  Java might
actually become almost useful if it let the developer do the memory
management.

-- 
Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list