TIP: Click on subject to list as thread! ANSI
echo: apple
to: comp.sys.apple2
from: mdj
date: 2009-03-05 23:11:34
subject: Re: A 21st Century Apple II?

On Mar 6, 4:17=A0pm, apple2fr...{at}gmail.com wrote:

> If you bother to visit the site and compare, for example, the Java 6
> client (with JIT compiler) to C++ Intel, you will note the following:
>
> For all 17 benchmarks, Java is never faster than C++, and up to 10x
> slower.

You mean like in the binary tree benchmark (number is CPU time):

1.0	Java 6 -Xms64m #2 	2.89
1.5	C++ GNU g++ #2 	4.47

Or the sum-file benchmark:

1.5	Java 6 -server #4 	4.10
1.5	Java 6 -Xms64m #4 	4.11
2.2	C++ Intel #2 	6.12
2.4	C++ GNU g++ #2 	6.47

Or spectral norm:

1.0	C++ GNU g++ 	23.84
1.0	Java 6 -Xms64m 	24.01

OK, C++ won that one, and by a whopping 1% too.

Such is the way with language speed - never assume you're correct,
always check the numbers.

I'll also facetiously point out that the two benchmarks listed where
Java wins comprehensively are the only two that do either memory de-
allocation or disk I/O. parallel non-blocking memory deallocation will
always beat serialised deallocation for CPU time.

> For all 17 benchmarks, Java uses from 4 to 35 times more memory than
> the corresponding C++ program. =A0In Java's defense, these are small
> benchmarks, as the percentage difference would become smaller for
> bigger programs.
>
> > As for memory usage, Java is always worse, sometimes by an order of
> > magnitude and then some. Fortunately though, this difference is only
> > extreme in very small programs (which don't use much memory anyway)
> > and the gap closes to a few percentage points as the application size
> > grows. As a selection criteria, it's also useless.
>
> Here I believe you are wrong. =A0I just loaded up Pages 2008 (Apple's
> version of MS Word) on my (Intel) Mac. =A0It has a RSS of 77 megabytes,
> and is, I believe, implemented in Objective C (which is more-or-less
> equivalent to C++). =A0Next, I loaded up OpenOffice 3.0 (which is
> implemented in Java) and selected the word processor. =A0It has a RSS of
> 130 megabytes, which is 69% larger. =A0Both pieces of software implement
> approximately equivalent sets of functionality. =A0This is far from the
> few percent as you suggest.

I wasn't aware OpenOffice was rewritten from its original C++ to
Java ? It certainly does use Java to implement some extensions, so you
would get a memory increase from having the JVM loaded, but the lions
share of the codebase is C++

Also, how is Objective-C equivalent to C++? In the same way Smalltalk
is equivalent to Python ?

> > That about runs us out of commercial reasons to prefer C++ over Java.
> > Of course, for personal projects there's always aesthetics, and it's
> > pretty obvious we have some different ideas there ;-)
>
> Language selection will always be a religious issue. =A0C++ has
> advantages in some areas, and Java in others (especially from a
> management point of view).

I prefer utilitarian perspectives rather than religious ones for
language selection, which is to say I believe the problem domain (and
the existing environment the solution must live in) will provide all
the necessary metrics to make an informed choice, without having to
resort to my personal prejudices.

> I prefer languages that were designed by programmers for programmers,
> and are not infected with ideas from committees or management.
> Ultimately, however, any halfway decent programmer should be able to
> program in any computer language given a few days to come up to speed
> with it. =A0Sadly, such a yardstick probably rules out more than 90% of
> people who call themselves programmers today.

All very true. I don't believe it's any worse than any other industry,
just another fact of modern life :-S

Matt
--- SBBSecho 2.12-Win32
* Origin: Derby City Gateway (1:2320/0)
SEEN-BY: 10/1 3 34/999 120/228 123/500 128/2 140/1 222/2 226/0 236/150 249/303
SEEN-BY: 250/306 261/20 38 100 1404 1406 1410 1418 266/1413 280/1027 320/119
SEEN-BY: 393/11 396/45 633/260 267 712/848 800/432 801/161 189 2222/700
SEEN-BY: 2320/100 105 200 2905/0
@PATH: 2320/0 100 261/38 633/260 267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.