Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?  
Author Message
asj





PostPosted: 2004-5-5 13:27:00 Top

java-programmer, Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? The old notion that Java on desktops is slow might have to go out the
window if more studies show this:

http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html

Again, this points out the fact that there will probably be a
renaissance of Java on desktops as it percolates on Linux and Macs and
Windows desktops. We use Mac OS X iMacs at work and Java apps as
MoneyDance (a personal finance software that runs on all 3 desktops,
although it looks sorta crappy in windows) are very good looking and
extremely fast.

Now, if only IBM's open source eclipse made better looking SWT apps on
Mac and Linux...
 
Risotto





PostPosted: 2004-5-5 14:26:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? asj wrote:

> The old notion that Java on desktops is slow might have to go out the
> window if more studies show this:
>
> http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
>
> Again, this points out the fact that there will probably be a
> renaissance of Java on desktops as it percolates on Linux and Macs and
> Windows desktops. We use Mac OS X iMacs at work and Java apps as
> MoneyDance (a personal finance software that runs on all 3 desktops,
> although it looks sorta crappy in windows) are very good looking and
> extremely fast.
>
> Now, if only IBM's open source eclipse made better looking SWT apps on
> Mac and Linux...

At the Sun Tech Days seminar here in Seattle, they had a presentation by
Apple ( and the Apple speaker appeared in other presentations).

There seemed to be a /budding/ relationship between the two.

 
Kevin McMurtrie





PostPosted: 2004-5-5 15:07:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? In article <email***@***.com>,
email***@***.com (asj) wrote:

> The old notion that Java on desktops is slow might have to go out the
> window if more studies show this:
>
> http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
>
> Again, this points out the fact that there will probably be a
> renaissance of Java on desktops as it percolates on Linux and Macs and
> Windows desktops. We use Mac OS X iMacs at work and Java apps as
> MoneyDance (a personal finance software that runs on all 3 desktops,
> although it looks sorta crappy in windows) are very good looking and
> extremely fast.
>
> Now, if only IBM's open source eclipse made better looking SWT apps on
> Mac and Linux...

Of course the C version of such a test will loose. Pascal would run
even faster. The key here is the format of the strings being tested and
the similarity of the contents.

As for Objective-C, Apple should dump it because it's a butt-ugly
language that nobody wants to use. Steve Jobs could apply 240KV to his
balls and still not have a strong enough Reality Distortion Field to
encourage Cocoa development. He could monkeyboy dance like Steve
Ballmer and developers will still break into cold sweats when they think
about the nightmares using Objective-C for real product development.

Eclipse will be pretty sweet once it gets a tune-up to run faster. I've
been using the stream builds and it looks totally different on each new
version. It looks like they're searching for a new GUI design.
 
 
Peter Ammon





PostPosted: 2004-5-5 15:08:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? asj wrote:
> The old notion that Java on desktops is slow might have to go out the
> window if more studies show this:
>
> http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
>
> Again, this points out the fact that there will probably be a
> renaissance of Java on desktops as it percolates on Linux and Macs and
> Windows desktops. We use Mac OS X iMacs at work and Java apps as
> MoneyDance (a personal finance software that runs on all 3 desktops,
> although it looks sorta crappy in windows) are very good looking and
> extremely fast.
>
> Now, if only IBM's open source eclipse made better looking SWT apps on
> Mac and Linux...

Java doesn't natively support many of the Objective-C idioms, which is
why Cocoa/Java has so many contortions (like the NSSelector class).
Should Cocoa go Java-only, it wouldn't be nearly as interesting.

--
Pull out a splinter to reply.
 
 
Peter Ammon





PostPosted: 2004-5-5 15:27:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? Kevin McMurtrie wrote:

> In article <email***@***.com>,
> email***@***.com (asj) wrote:
>
>
>>The old notion that Java on desktops is slow might have to go out the
>>window if more studies show this:
>>
>>http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
>>
>>Again, this points out the fact that there will probably be a
>>renaissance of Java on desktops as it percolates on Linux and Macs and
>>Windows desktops. We use Mac OS X iMacs at work and Java apps as
>>MoneyDance (a personal finance software that runs on all 3 desktops,
>>although it looks sorta crappy in windows) are very good looking and
>>extremely fast.
>>
>>Now, if only IBM's open source eclipse made better looking SWT apps on
>>Mac and Linux...
>
>
> Of course the C version of such a test will loose. Pascal would run
> even faster. The key here is the format of the strings being tested and
> the similarity of the contents.

Turn on -mdynamic-no-pic and the C version beats the Java version by ~
30%. Make those C strings const (and do the corresponding operation
with final in Java) and the C version becomes more than one hundred
times faster than the Java version.

Just goes to show that benchmarks are easy to manipulate.

>
> As for Objective-C, Apple should dump it

Dump it for what? Have you seen what Cocoa/Java is like? It's not
exactly ready to replace Objective-C.

> because it's a butt-ugly
> language that nobody wants to use. Steve Jobs could apply 240KV to his
> balls and still not have a strong enough Reality Distortion Field to
> encourage Cocoa development. He could monkeyboy dance like Steve
> Ballmer and developers will still break into cold sweats when they think
> about the nightmares using Objective-C for real product development. >

What nightmares are those?

> Eclipse will be pretty sweet once it gets a tune-up to run faster. I've
> been using the stream builds and it looks totally different on each new
> version. It looks like they're searching for a new GUI design.

A faster Eclipse on the Mac would be most welcome.

--
Pull out a splinter to reply.
 
 
Howard Shubs





PostPosted: 2004-5-5 19:55:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? In article <aO%lc.7687$email***@***.com>,
Risotto <email***@***.com> wrote:

> There seemed to be a /budding/ relationship between the two.

Keep in mind that Sun is in deep trouble.

--
When did we become machines to be serviced
rather than people to be served?
I'm a customer, not a consumer.
 
 
clvrmnky





PostPosted: 2004-5-6 0:00:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? On 05/05/2004 1:26 AM, asj wrote:

> The old notion that Java on desktops is slow might have to go out the
> window if more studies show this:
>
> http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
>
Hmmm. I'm not sure that any byte-code language could keep up with a
properly compiled application. There has been a lot of discussion
around Apple's non-choice to go with a seriously untuned GCC for
compiling Obj-C.

The resulting object code is at a serious disadvantage when compared
with compilers tuned specifically for the PPC. Not all compilers are
created equal, and Apple's GCC is known to have a lot of bottle-necks in
both the object code and runtime libraries.

There is no reason why Objective-C should necessarily be slower than
similar Java code, even with late-binding.
--
cm
 
 
Kevin McMurtrie





PostPosted: 2004-5-6 0:35:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? In article <aO%lc.7687$email***@***.com>,
Risotto <email***@***.com> wrote:

> asj wrote:
>
> > The old notion that Java on desktops is slow might have to go out the
> > window if more studies show this:
> >
> > http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
> >
> > Again, this points out the fact that there will probably be a
> > renaissance of Java on desktops as it percolates on Linux and Macs and
> > Windows desktops. We use Mac OS X iMacs at work and Java apps as
> > MoneyDance (a personal finance software that runs on all 3 desktops,
> > although it looks sorta crappy in windows) are very good looking and
> > extremely fast.
> >
> > Now, if only IBM's open source eclipse made better looking SWT apps on
> > Mac and Linux...
>
> At the Sun Tech Days seminar here in Seattle, they had a presentation by
> Apple ( and the Apple speaker appeared in other presentations).
>
> There seemed to be a /budding/ relationship between the two.

Sun is trying to forge relationships with everybody. You can't run
their new Java projects without going on a scavenger hunt for a dozen
random Apache and IBM libraries. Trying to integrate all that with an
existing product is a mess.
 
 
GreyCloud





PostPosted: 2004-5-6 1:30:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?

Howard Shubs wrote:

> In article <aO%lc.7687$email***@***.com>,
> Risotto <email***@***.com> wrote:
>
>
>>There seemed to be a /budding/ relationship between the two.
>
>
> Keep in mind that Sun is in deep trouble.
>

What trouble?? I've not seen anything yet that indicates that they are
in trouble.

 
 
Dr Chaos





PostPosted: 2004-5-6 2:33:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? On 4 May 2004 22:26:36 -0700, asj <email***@***.com> wrote:
> The old notion that Java on desktops is slow might have to go out the
> window if more studies show this:
>
> http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
>
> Again, this points out the fact that there will probably be a
> renaissance of Java on desktops as it percolates on Linux and Macs and
> Windows desktops. We use Mac OS X iMacs at work and Java apps as
> MoneyDance (a personal finance software that runs on all 3 desktops,
> although it looks sorta crappy in windows) are very good looking and
> extremely fast.
>
> Now, if only IBM's open source eclipse made better looking SWT apps on
> Mac and Linux...

In straight integer performance without libraries, Java now is
fast, if you also ignore startup time.

Objective-C's object model is more like Smalltalk---except
that programs pop up and dynamically link and display their fancy
GUI really fast.

You pay in performance for some dynamism there, and gain some
benefits in flexibilityi.

There's no reason why some hypothetical pre-cached Java shouldn't be
fast to startup and link too.

The question is really whether the libraries and object models
in Java are better than the O-C in Cocoa.
 
 
Dr Chaos





PostPosted: 2004-5-6 2:39:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? clvrmnky <email***@***.com> wrote:
> On 05/05/2004 1:26 AM, asj wrote:
>
>> The old notion that Java on desktops is slow might have to go out the
>> window if more studies show this:
>>
>> http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
>>
> Hmmm. I'm not sure that any byte-code language could keep up with a
> properly compiled application. There has been a lot of discussion
> around Apple's non-choice to go with a seriously untuned GCC for
> compiling Obj-C.
>
> The resulting object code is at a serious disadvantage when compared
> with compilers tuned specifically for the PPC. Not all compilers are
> created equal, and Apple's GCC is known to have a lot of bottle-necks in
> both the object code and runtime libraries.

The answer is $$$. Presumably Apple could pay for, and then spend lots
of effort modifying IBM's Power PC compiler, and then license it
for $1000 a shot or whatever IBM typically does on AIX.

And at that price how many would really buy it when GCC is free?

Maybe the new GCC intermediate representation coming up (gcc 3.5-3.6?)
will permit better optimization.

> There is no reason why Objective-C should necessarily be slower
> than similar Java code, even with late-binding. -- cm

True, the question is how much natural Objective-C code is truly
similar? I bet a fair amount of interaction with libraries involve
more dynamic Smalltalk-like constructions than typically done with Java.

This is good probably and makes programming easier, but could
conceivably have some performance cost. For user-interfaces it likely
doesn't matter much.
 
 
clvrmnky





PostPosted: 2004-5-6 3:11:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? On 05/05/2004 2:39 PM, Dr Chaos wrote:
> clvrmnky <email***@***.com> wrote:
>
>>On 05/05/2004 1:26 AM, asj wrote:
>>
>>
>>>The old notion that Java on desktops is slow might have to go out the
>>>window if more studies show this:
>>>
>>>http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
>>>
>>
>>Hmmm. I'm not sure that any byte-code language could keep up with a
>>properly compiled application. There has been a lot of discussion
>>around Apple's non-choice to go with a seriously untuned GCC for
>>compiling Obj-C.
>>
>>The resulting object code is at a serious disadvantage when compared
>>with compilers tuned specifically for the PPC. Not all compilers are
>>created equal, and Apple's GCC is known to have a lot of bottle-necks in
>> both the object code and runtime libraries.
>
> The answer is $$$. Presumably Apple could pay for, and then spend lots
> of effort modifying IBM's Power PC compiler, and then license it
> for $1000 a shot or whatever IBM typically does on AIX.
>
That, and the IBM compiler was not ready for porting at any price when
Apple was assembling the Darwin build tools. I read the whole sordid
tale on someone's website. I cheerfully accept I could be misinformed
by the web.

>> There is no reason why Objective-C should necessarily be slower
>>than similar Java code, even with late-binding. -- cm
>
> True, the question is how much natural Objective-C code is truly
> similar? I bet a fair amount of interaction with libraries involve
> more dynamic Smalltalk-like constructions than typically done with Java.
>
> This is good probably and makes programming easier, but could
> conceivably have some performance cost. For user-interfaces it likely
> doesn't matter much.

Exactly. Though, it is the user-interface that most people complain
about when they say "Java is slow". A lot of perceived slowness or
memory issues in either Java or Obj-C UIs can probably be coded away by
a decent GUI programmer. I don't have any non-trivial examples to play
with, so all of this is academic anyway.

--
cm
 
 
asj





PostPosted: 2004-5-6 3:19:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? Howard Shubs <email***@***.com> wrote in message news:<email***@***.com>...

> Keep in mind that Sun is in deep trouble.

keep in mind that sun has $5 billion cash eq. in the bank, low debt,
is twice the size of apple in revenues and has a higher market
capitalization than apple.
 
 
Kelsey Bjarnason





PostPosted: 2004-5-6 7:23:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? [snips]

On Wed, 05 May 2004 00:07:18 -0700, Kevin McMurtrie wrote:

> Of course the C version of such a test will loose.

On the other hand, properly-written C code helps somewhat.

The code provided runs and generates a result of about 48000 and change on
this machine. My cleaned-up code provides a result of 970000; a speedup of
about 20 times. Mine also does 10 times more loops yet finishes faster.

[test]./original
Operations: 1000000 Seconds: 20.606744 Operations/second: 48527.802354

[test]./benchmark
Operations: 1000000 Seconds: 1.021891 Operations/second: 978577.950094

Both, obviously, do the same number of "operations" - runs of the inner
loop. The original inner loop runs from 0-100; mine runs 0-1000.

So, in reality, my speedup isn't 20 times... it's *200* times. Without
doing a single special thing to tune, tweak or otherwise optimize the
code. Just a matter of writing C code properly.

I'm not a Java geek, so I can't really comment on the quality of the Java
code provided. If it's comparable to the C code, I'd suspect his Java
results were about as good as his C results... i.e. not very.


 
 
Tim Smith





PostPosted: 2004-5-6 11:48:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? In article <1c8mc.36759$email***@***.com>, clvrmnky wrote:
> Hmmm. I'm not sure that any byte-code language could keep up with a
> properly compiled application. There has been a lot of discussion

Java is compiled on most systems.

--
--Tim Smith
 
 
The Ghost In The Machine





PostPosted: 2004-5-6 12:01:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? In comp.lang.java.advocacy, GreyCloud
<email***@***.com>
wrote
on Wed, 05 May 2004 11:29:53 -0600
<email***@***.com>:
>
>
> Howard Shubs wrote:
>
>> In article <aO%lc.7687$email***@***.com>,
>> Risotto <email***@***.com> wrote:
>>
>>
>>>There seemed to be a /budding/ relationship between the two.
>>
>>
>> Keep in mind that Sun is in deep trouble.
>>
>
> What trouble?? I've not seen anything yet that indicates that they are
> in trouble.
>

Dunno, but last time I checked they didn't have enough cash to
last out the year given their "burn rate". Then again, maybe
things are picking up; I'd have to look. (If they are, more
power to them. Sun may have a problem in the technical side since
Java is still proprietary, but it's arguably the most widely
used middleware tech as of right now.)

--
#191, email***@***.com
It's still legal to go .sigless.
 
 
Howard Shubs





PostPosted: 2004-5-6 19:52:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? In article <email***@***.com>,
GreyCloud <email***@***.com> wrote:

> What trouble?? I've not seen anything yet that indicates that they are
> in trouble.

Then you've not been paying attention. I suggest you look before you
buy more of their hardware.

--
When did we become machines to be serviced
rather than people to be served?
I'm a customer, not a consumer.
 
 
asj





PostPosted: 2004-5-6 23:11:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? The Ghost In The Machine <email***@***.com> wrote in message news:<email***@***.com>...
>
> Dunno, but last time I checked they didn't have enough cash to
> last out the year given their "burn rate". Then again, maybe
> things are picking up; I'd have to look. (If they are, more
> power to them. Sun may have a problem in the technical side since
> Java is still proprietary, but it's arguably the most widely
> used middleware tech as of right now.)

i suggest to check again. they have $5 billion in cash eq (and have
had so for a while now, with no signs that their balance sheet is in
any danger of going down), low debt, and a significant part of those
"losses" are actually non-cash, but things like one-time charges.

remember, sun is a $12 BILLION dollar company, with very high profit
margins, so they could simply stop doing research for a few months and
they would magically be in the black.
 
 
CJT





PostPosted: 2004-5-6 23:34:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? Howard Shubs wrote:

> In article <email***@***.com>,
> GreyCloud <email***@***.com> wrote:
>
>
>>What trouble?? I've not seen anything yet that indicates that they are
>>in trouble.
>
>
> Then you've not been paying attention. I suggest you look before you
> buy more of their hardware.
>

They've got billions in cash (more, proportionately, than Microsoft, I
believe) -- they're not going away.

--
The e-mail address in our reply-to line is reversed in an attempt to
minimize spam. Our true address is of the form email***@***.com.
 
 
CJT





PostPosted: 2004-5-6 23:36:00 Top

java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? asj wrote:

> The Ghost In The Machine <email***@***.com> wrote in message news:<email***@***.com>...
>
>>Dunno, but last time I checked they didn't have enough cash to
>>last out the year given their "burn rate". Then again, maybe
>>things are picking up; I'd have to look. (If they are, more
>>power to them. Sun may have a problem in the technical side since
>>Java is still proprietary, but it's arguably the most widely
>>used middleware tech as of right now.)
>
>
> i suggest to check again. they have $5 billion in cash eq (and have
> had so for a while now, with no signs that their balance sheet is in
> any danger of going down), low debt, and a significant part of those
> "losses" are actually non-cash, but things like one-time charges.
>
> remember, sun is a $12 BILLION dollar company, with very high profit
> margins, so they could simply stop doing research for a few months and
> they would magically be in the black.

I think you have to alter that to say "very high _potential_ profit
margins," since they've been losing money for quite a while now.

--
The e-mail address in our reply-to line is reversed in an attempt to
minimize spam. Our true address is of the form email***@***.com.