Java 1.4.0 is out...

Status
Not open for further replies.

EgalitarianBovine

Ars Tribunus Angusticlavius
8,086
Good to see some of the new additions.

I'm not too concerned with the speed of java right now, so the changes to Swing to make it faster and jitting don't really cause me to perk up.

On the other hand, asynchronous IO (thank the lord.. I don't know how the hell people wrote serious network apps in Java without this), regexp, crypto framework, all integrated into the standard distribution. All of those are damn useful libraries.

Hopefully the next release will roll in changes to allow parametric types (i.e., equivalent of templates in C++, except not stupid and hackish like they are in C++)

-EB
 

_klamath_

Ars Scholae Palatinae
770
I'm running on an Athlon 600 w/128 RAM and Swing programs are just as responsive as their windows counterparts.

Perhaps Linux performance is substantially worse; in any case, Swing is a total dog on my P3 850 with 850 MB of RAM. Before JDK 1.4, it literally takes seconds to repaint the screen if you maximize an app. With JDK 1.4 this is somewhat improved, but not hugely.
 

Sheriff

Ars Tribunus Militum
1,841
Originally posted by Nimdok:
Quote: "Good because Swing is still slow as shit."

Examples? What is your configuration?

I'm running on an Athlon 600 w/128 RAM and Swing programs are just as responsive as their windows counterparts.

Swing(of any reasonable complexity) is noticeably slower for me on an athlon 950 with 512mb than with any comparable native app. with 1.3 that is, havent tried 1.4.
 
Anyone tried JBuilder? :) Now that's Java, and that's very slow.

Or Together? That's Java, and it's slow.

Java, by its very nature, isn't ever going to be as fast as a native GUI system. Because Java is built as a VM, which means anything you do in the VM has to some how be translated to a real-machine equivalent. Period. It could approach speeds that are like native GUI systems, but it will never be equal.

Speaking of which, I've never used a .NET application, but are they fast? Seeing as how they are compiled to IL correct? That is a bytecode like Java, so is it fast?
 

gumbo

Ars Tribunus Angusticlavius
6,107
It depends on how it was coded too. JBuilder loads slowly - about 2 seconds for each window I open.

If I create a new example with several tabbed panes, text areas, buttons, labels, etc, and test it out, it is slow. However, if I load each window as it is needed, it becomes much faster, almost to the speed of a native app. Much of Swing's slowness can be attributted to bad coding design or bad interface loading designs.

gubmo
 
Originally posted by Nimdok:

Examples? What is your configuration?

I'm running on an Athlon 600 w/128 RAM and Swing programs are just as responsive as their windows counterparts.

On my PIII 450, 448 RAM, Swing is much slower than the win32 interface. I only use java when I cannot do it in C++ and that's a real shame because I love the language and dislike bits of C++.

A good example of a slow java GUI application is jbuilder 6.

I forgot to say, it also takes exactly 30 seconds to start...
 

TheJet

Ars Praefectus
4,598
Subscriptor++
Well you won't like .NET then either ;) The VS.NET interface is painfully slow on a PII-450 that I've used it on, and only becomes acceptably responsive on my P3-1G with 512MB RAM. The RTM seems to be faster than the Beta2/RC builds that I used, but it is still nowhere close to the speed of its VS6 counterparts.

Maybe we'll just have to get used to menus that takes seconds to appear and programs that take 10s of seconds to load again ;) Welcome back days of the 386/486!!! Didn't everyone know that someone would find a way to make our machines slow again so we'd have to upgrade? After all, it was becoming possible to do all your development on a P3-733/Athlon-700 w/ 512-768M of RAM, thanks to Java and .NET, we've been thwarted again! :D Now you'll only need a P4-3G/Athlon-2000+ machine with 1.5G of CAS2 DDR to run your development environment at acceptable speeds. ;)

TheJet
 

dhopton

Ars Tribunus Militum
2,009
My p3-700/512mb/9gb HD laptop is great for VS.net - there is a *slight* perf drop (and i mean slight) with VS.net in the UI, and that is because it's doing some really funky things (Dynamic Help for example - a *brilliant* help implementation) in the background. On my dually p3-700/768mb/9gb SCSI desktop, I notice no differance compared to VS6. Some times large projects are an arse, but I think that is not perf slowing it down, just the damned thing being iffy.

Sometimes the CLR does take a while to get moving (4 or 5 secs) but not hugely noticable after the first app has run.
 

walkern

Smack-Fu Master, in training
53
I wouldn't really judge the speed of the CLR (.NET Runtime) based on Visual Studio - VS.NET isn't really a .NET app. It contains a mixture of managed and unmanaged code.

As for Cobalt's assertion that a JVM will never be as fast as an interpreted language, I would have to disagree. First of all, just to be clear, neither Java nor .NET really use a 'VM' anymore - they use a JIT compiler. And runtime compilation has some definite advantages - you know a lot more about a program at runtime than traditional compile-time, and more optimizations are possible. Too many people assume that there is something inherent in translation that is slower - not the case! It's only slower if you are unable to optimize more than the cost in the translation itself.

A little discussion of this kind of optimization (from the hardware point of view) can be found here:Ars' blackpaper on HP Dynamo
 

Midlands

Ars Praetorian
535
Subscriptor
Originally posted by Cobalt:
Java, by its very nature, isn't ever going to be as fast as a native GUI system. Because Java is built as a VM, which means anything you do in the VM has to some how be translated to a real-machine equivalent. Period. It could approach speeds that are like native GUI systems, but it will never be equal.

Speaking of which, I've never used a .NET application, but are they fast? Seeing as how they are compiled to IL correct? That is a bytecode like Java, so is it fast?

A great deal of the slowdown in Swing and AWT apps has to do with the design and implementation of the Swing and AWT libraries, rather than the VM. To put it bluntly, they seriously suck.

As a server-side Java programmer, it is my great annoyance that Swing and the AWT suck as much as they do, because it's what gives the impression that Java is "dog-slow". In fact, Java is not even remotely "dog-slow" for what I do -- we use more CPU than a C/C++ implementation, but not a great deal more, and since we're not CPU-bound it's mostly irrelevant anyway -- but the fact that most people think of various Swing/AWT programs they've written as being the canonical example of "Java" is rather frustrating.

(Of course, I will be first to admit that those programs _are_ dog-slow. The Oracle Universal Installer comes to mind...)
 
I used Java 1.4.0's javac and jar to compile and package a few class
files and Java 1.1 applet enviroments (NS and IE) weren't able to
extract and run the class files.

I switched back to 1.3.1_01 and everything was fine again. Anyone else
experience a problem like this? Everything else in 1.4.0 seems to be
working fine or better than before. Like fonts in X11 don't suck
anymore and (of course) the mouse wheel works.

~Kevin
:)
 
As for Cobalt's assertion that a JVM will never be as fast as an interpreted language, I would have to disagree. First of all, just to be clear, neither Java nor .NET really use a 'VM' anymore - they use a JIT compiler. And runtime compilation has some definite advantages - you know a lot more about a program at runtime than traditional compile-time, and more optimizations are possible. Too many people assume that there is something inherent in translation that is slower - not the case! It's only slower if you are unable to optimize more than the cost in the translation itself.

My point is this, because it uses bytecode that MUST be the same across ALL platforms, I don't give a rat's ass about how much they optimize it, it will never be AS fast as something that is compiled straight for the architecture being used. It is not possible.

It still has to use JIT, even if JIT is fast, it is not as fast as NOT HAVING TO DO JUST IN TIME COMPILATION!

I'm not claiming that Java is slow, in fact I love it, and think it is great in lots and lots of situations. BUT, it is an obvious fact that it will never be as fast as something compiled to a given architecture.

The minute you add a layer of abstraction between what you're coding to and what the real machine is, what you end up with is something slower. Not by much if you do it right, but it will not be as fast.

Computer 1 - Pentium 4 2.0 Ghz
Computer 2 - SPARC workstation

Program 1 - Java program
Program 2 - Program compiled to specific architecture that does same thing as Program 1

Now, the Java bytecode you get after compiling Program 1 will run on Computer 1 and 2.

The binary you get after compiling Program 2 on Computer 1 and 2 will be different.

To claim that Java can ever be as fast as something compiled to a specific architecture is to claim that the universal bytecode for Program 1 is equivalent to the compiled code (instruction for instruction) to that of Program 2 for EACH architecture. Obviously the bytecode can't be 2 things at once, THEREFORE, somewhere you're interpreting into actual machine instructions between the Java bytecode, and something that will run on your specific machine.

If this doesn't make sense, I may have explained it poorly, or you may not understand how VM systems work, and how Java functions.
 

_klamath_

Ars Scholae Palatinae
770
Do we have operator overloading yet?

I don't understand why anyone would want to use this, or even consider it an important feature of a language. At best, it's syntactic sugar -- and if used improperly, it can be very confusing. For very simple examples, it might make some degree of sense: say, implementing a "complex number" class. But once one deals with the real world, the situations in which operator overloading are at all useful are pretty rare, IMHO. Take streams -- what is the benefit to using "<<" to write to them and "<<" to read from them? Why not just use read() or write()? Not only would that be easier to understand, it would also be more flexible -- what if you want to do readLine(), for instance? Which "operator" would that be? IMHO, the basic idea of operators doesn't fit into the OO paradigm very well -- and the less often they are used, the better.

My favorite language (Ruby) allows this -- but only in the sense that an "operator" is just a method call, and you can override the default method definitions or provide your own ones (e.g. indexing into an array is done by called the [] instance method, passing it the key). So I think if Java or C++ had clean object models in the first place, there wouldn't be any need to add this as a "feature", it would just be a by-product of a good design.
 

petrov

Ars Tribunus Militum
2,714
the discussion over whether java code will ever be fast as native largely misses the point. GUI code doesn't need to be fast. It needs to be fast enough. Fast enough that the user doesn't get irritated. And frankly, Swing isn't there yet.

This is an important distinction because in N years time when CPUs are sufficiently fast, it's quite likely that the sucktacular Swing implementation will start being fast enough for GUI uses, but that java code will still run slower than native code. The issue at hand is that Sun has not optimized swing to run fast enough on current processors, not that java per se is slow or not.

--sam
 

xeraae

Wise, Aged Ars Veteran
132
Not having operator overloading is part of Java's design. It is an intentional omission, and in all likelyhood won't be added. Check this out.

2.2.7 No More Operator Overloading
There are no means provided by which programmers can overload the standard arithmetic operators. Once again, the effects of operator overloading can be just as easily achieved by declaring a class, appropriate instance variables, and appropriate methods to manipulate those variables. Eliminating operator overloading leads to great simplification of code.

http://java.sun.com/docs/white/langenv/Simple.doc2.html

This is good, IMHO.
 

dockeen

Ars Tribunus Militum
1,600
Hmmm, I don't even get as far as it asking me for a mirror. In one case, I got as far as it asking me to "sign" the license, then when I hit accept, it errored saying there was a bad address. Most other times I click on one of the links to download the JRE (or JSDK) and it errors out there...

Running Win98 on this machine with the 1.4 RC on it.

Wayne
 

dockeen

Ars Tribunus Militum
1,600
None of the other links that I have tried have worked.

The only other thing I can think of is this machine
has had the new Microsoft IE patch installed. If that
is the cause of the problem, then my work machine may
have problems as well...

I will try when I get to work, which, as it turns out,
won't be until Tuesday, because of President's day.
Not that I have the day off mind you, just that I can't
get to my 'puter on base.

:rolleyes: :rolleyes: :rolleyes:

Wayne
 

Victim12

Ars Tribunus Militum
1,978
My point was addressing earlier posts. My only point is that no matter how fast it gets, it won't ever be as fast as compiled code.

Well, once I took a quick look at an article somewhere that was talking about different optimizations that are possible with JIT that you can't do if you compile everything to native code beforehand. Unfortunately I can't find it or remember anything about it, I didn't really understand it all anyway. But I do have first hand experience of some Java code running faster than the equivalent C++.

[This message was edited by Victim12 on February 17, 2002 at 13:06.]
 

dockeen

Ars Tribunus Militum
1,600
I seem to remember a few years ago there was an aerospace company which was designing a purpose built processor which amounted to, I believe, a JVM in silicon. They were going to use it for avionics applications. Conceivably, it could be pretty fast in that application, though language specific chips have somewhat of a checkered past.

Wayne

(or maybe I just dreamt all this)
 
Cobolt:
My point was addressing earlier posts. My only point is that no matter how fast it gets, it won't ever be as fast as compiled code.

It can never get as fast at "start up time" that much is true. (That is, the latency you experience between executing the file to you start getting results.)

However, for programs that run for a long time it is not at all certain. Runtime optimiing JIT's like Hotspot can do a lot of work here. They are still nowhere near their optimal stage.

(Unfortunately I can't seem to find any benchmarks comparing and analysing Hotspot and native code. I bet there are a few around however.)
 
Status
Not open for further replies.