Sun to Amp Java for Desktop Performance? 88
mactari writes "Java client application developers should take a look at Sun's J2SE Client Developer Survey. Swing's relative slowness has always made a Java app with a GUI look and feel slow, and Sun might finally be doing something about it. Questions on the survey suggest Sun is considering moving away from a crossplatform look and feel (eg, Metal) towards native looks by default. If Sun is going to follow the suit played by IBM's native widget toolkit, SWT, or do things on individual platforms like Apple has done with its hardware accelerated version of Aqua-Swing, Java might finally find its way to becoming a competitor on the desktop."
Jave for performance... (Score:3, Funny)
Re:Jave for performance... (Score:1)
seriously, what are you referring to? A Google search came up with the Java ASCII editor... but somehow I don't think that's what you meant?
Re:Jave for performance... (Score:1)
Sun on the desktop? (Score:1, Insightful)
Also just because some Marketing folks threw up a survey doesn't mean squat. Maybe it's just to get people wishing (again).
Native look and feel? (Score:4, Funny)
Oh yeah. AWT.
Re:Native look and feel? (Score:2, Insightful)
Solution?
I dont know, but I can make a list of what it's gotta do
1) Code nicely, I don't want to have to type off my right hand and get an aneurism just to make a window look the way I want it to.
2) Look right. The widgets and windows should look as they do on whatever platform you are using. They should also inherit any style pre
Re:Native look and feel? (Score:2)
I especially think that point #7 is very important. It's clear to me that separating the GUI design from the code is the way to go. GUI design and programming are very different tasks -- sometimes people are godd at one and not the other. Plus, GUIs should be done in a different language than programming -- something descriptive, not procedural.
I've used GLADE (for GTK/GNOME) and it makes a nice
Have fun (Score:1, Interesting)
Believe me when I tell you you're in a minority.
One of the features of Java I appreciate most is coding GUIs by hand. Its one of the few languages that gives me the control over the look, feel, and layout that I simply can't get in other platforms.
I find that people who dont like the system simply haven't tried some of the (much much worse) alternatives.
if you want a click-a-button-to-get-a-button gui design system, careful about it. It can easily limit your abilities t
Re:Have fun (Score:2, Insightful)
Re:Have fun (Score:2)
Writing simple GUIs using drag and drop is easy.
Writing complex GUIs using drag and drop (VB's style of drag and drop) is a pain.
Re:Have fun (Score:2, Informative)
Java isolates from other innovations and toolkits (Score:2)
Until the bindings are possible, it's going to be a niche product.
Re: (Score:2, Informative)
Bindings are possible (Score:5, Informative)
Java-gnome [sourceforge.net] Just check out google for others.
Re:Java isolates from other innovations and toolki (Score:2)
Just how does one #include say solve.h which I wrote in C for solve.c which #include in Java.
So maybe I was wrong...
Still you can't link to a c library and produce a completely java product.
If you could I just might consider it. A java linux distro might be pretty cool.
Re:Java isolates from other innovations and toolki (Score:1)
One doesn't. Nor does he in Python, Perl, Ruby, C#, or any other language that's not C. One writes whatever compability layer must be made to get those bindings.
Still you can't link to a c library and produce a completely java product.
Well, thanks for pointing out that, Mr. Obvious, I'd never have figured out that when linking into c library, that library is not automagically going to re-assemble itself into ja
Re:Java isolates from other innovations and toolki (Score:2)
Anyway that's a problem because it's starting to look like QNX's resource manager approach makes portability unnecesary.
Rather than porting an app you just set up a service that other apps of the same type agree on.
Re:Java isolates from other innovations and toolki (Score:1)
Re:Java isolates from other innovations and toolki (Score:1)
your point is fair... my response merely, "when we talk about what a language can do, aren't we saying, in a reasonably pretty way with a fairly mainline level of support?"
How many Java Faithful endorse using JNI to bind to C/C++ based GUI toolkits!?
Just Wondering (Score:2)
That isn't a rhetorical question. If you've got 'em, post 'em.
Re:Just Wondering (Score:2)
Re:Just Wondering (Score:2)
Them's the rules -- for the sake of this posting, they just don't. (You can probably figure out a good reason if you think about it.)
Re:Just Wondering (Score:2)
Re:Just Wondering (Score:4, Insightful)
Just because an IDE or a text editor is written in Java doesn't mean it can only be used to create other Java apps. That's the silliest thing I've ever heard.
Re:Just Wondering (Score:1)
I've used it to do some simple xml & html documents, some c(++), and sure, some Java as well. Amongst other things.
Same holds true for eg. Eclipse, even if it's optimized for Java there are plenty of features for writing software in other languages.
Re:Just Wondering (Score:2, Informative)
Re:Just Wondering (Score:2)
Re:Just Wondering (Score:2)
Freenet successful? (Score:2)
When I last tried it, it was excruciatingly slow, and eventually got stuck in an infinite loop that gradually consumed all of swap (or tried to, until I killed it). That might have been the JVM, but what difference does it make, really?
SWING kicks AWT's ass! (Score:5, Interesting)
I'm so annoyed by this "SWING is slow" canard. As a graphics programmer I can tell you aside from a few glitches in a few select JVM's SWING is much faster. Only poor programmers who try to implement their whole program in the event handler ever have a problem with SWING. Their programs would suck in AWT too, they would simply freeze with the OS redrawing the buttons. With all the work Sun has put into making threads drop dead easy to use there is absolutely no excuse. They have a hook for running things in a thread from a managed pool, and even a utility for running things in the Swing thread when you're done...
Re:SWING kicks AWT's ass! (Score:2)
Re:SWING kicks AWT's ass! (Score:1)
You say :wq, I say ZZ. Why can't we all just get along?
I say
Re:SWING kicks AWT's ass! (Score:2)
Re:SWING kicks AWT's ass! (Score:3, Interesting)
Chills just ran down my spine. We had some of those at a custom app house that moved from PowerBuilder to Java. The transition started before SWING and we rolled our own Thread pool and a "run in AWT Thread" utility. We finally did manage to get them out of the event loop on database queries by throwing up an error message if a blocking database call was attempted in the event loop, hehe (never got a complaint on that...they knew better after
Re:SWING kicks AWT's ass! (Score:3, Insightful)
AWT was just god awful. There were things you could do that would help, but it was much like pushing a yugo down a racetrack rather than getting a real car.
SWING came out and fixed some things. Client side JVM issues caused early adoption issues, and server side HTML generation via Servlets came into vogue. Many folks - myself included - said to hell with thick client apps and focused o
Re:SWING kicks AWT's ass! (Score:2)
Re:SWING kicks AWT's ass! (Score:4, Insightful)
First off, "SWING" is not an acronym. It's "Swing", or "JFC". Secondly, since Swing is NOT THREADSAFE it is already mandatory to implement any code that touches the UI in the event handler. What. You didn't know that? Most developers don't. It is awful and stupid, and I suspect it was done for performance reasons (which begs the question, if the majority of apps *are not* written this way, why do they appear to work fine?).
I like the idea of Swing. I like the APIs on the edge. But everything inside is a bloated sandwich of layers of cruft. In Swing, hard things are easier than in other toolkits, but *easy* things are often very cumbersome to implement (no, I do not want to implement an entire data model just for a drop-down list thank you!).
I like Swing in general, but it could certainly use some speedups and tweaks. In general I think the problem with Java is not so much that it is "slow" but that it is a memory pig (sorry to say), and that has a tendency to reveal itself in performance (i'm not sure much can be done by this...Moore's law will probably solve it faster than more code).
Begging (Score:1)
Re:SWING kicks AWT's ass! (Score:3, Informative)
Did you read my post? One of the things I pointed out was how easy they made it to run things in the event loop when you were done. Not being comfortable writing callbacks is a really scary 'programmer' attribute. It was done for performance reasons, knowing the order of drawing makes alpha blendings much more efficient. Even if alpha is 1.0. It's also m
Re:SWING kicks AWT's ass! (Score:4, Informative)
Umm...Eclipse uses SWT which uses native UI elements on platforms where it is implemented. The only time it emulates something is if there isn't a native widget.
Re:SWING kicks AWT's ass! (Score:2)
Re:SWING kicks AWT's ass! (Score:5, Insightful)
Read this interview with the Sun employees maintaining Swing:
http://developer.java.sun.com/developer/c
Here's an interesting quote:
"I think the single biggest difference between so-so and really great Swing apps has to do with the way developers handle threading issues. As everyone knows, Swing is "single threaded," and this often leads developers to avoid using multiple threads. However, this is a BIG MISTAKE. The fact is that you can use many threads in your Swing app; you just need to follow the rules."
The REAL problem with Swing is that the simplest way to implement any solution is usually also the wrong way. Too many people use DefaultTable model rather than building their own. Too many people subclass components because they 'don't get' UI Delegates. Too many people out there think that since Swing isn't thread safe (and they don't really understand threads enough to know what that means), they should let all their code run from the event thread. Swing's greatest weakness: bad programmers.
Re:SWING kicks AWT's ass! (Score:2)
I don't think there is anything wrong with using the simplest possible solution. The default model will work 70% of the tim
Re:SWING kicks AWT's ass! (Score:1)
Geez. Look at the very first line:
The problem with what you are saying is that the original post had assumed some context, namely knowledge of Swing or even UI programming in general.
Because simple solutions aren't always the most efficient. If you had a 32-processor machine, you could write your application the simple way, using onl
desparate times (Score:2, Interesting)
It's over... (Score:2)
Stop posting these ridiculous stories...
Oh... it's... not.. a joke...
Frigthened by C#? (Score:4, Insightful)
Microsoft, apart from marketing universal support for its platform, really is only interested in taking Java's piece of the cake.
You look at Java, it's one of the greatest OOP languages. Why would make developers switch? What's wrong with Java?
Performance.
As 80%+ of the users/developers are on Wintel, C#.NET will look like a nicer alternative to Java developers; Microsoft won't bother adding a graphical abstraction layer ontop of its API...
Marketing as well (Score:3, Interesting)
Java version did not sell (while I was staying there) and did not make great progress in terms of marketing; nonetheless,
Re:Frigthened by C#? (Score:2)
Be careful lumping users and developers together so sloppily. It seems the latter at least have other plans, Linux developers are coming from Windows [slashdot.org] in large numbers. There are many things to love about Java programming on Linux [javalinux.net].
Re:Frigthened by C#? (Score:3, Informative)
Cross-platform means non-optimal (Score:3, Interesting)
Of course, a true cross-platform application should have the same look and feel on every platform.
That's the problem with all these cross-platform technologies like Java, you always end up with an non-optimal solution. If an application can't take advantage of platform-specific features, why bother having multiple platforms?
Training time and associated cost (Score:4, Interesting)
Yes, we want to take advantage of each platform sometime, but that is not always the case. If you think about training cost and so forth, there are good reasons NOT TO adjust to every platform.
Re:Training time and associated cost (Score:2)
Of course, a web browser UI is a compromise in itself. As you say, sometimes there are good reasons not to adjust to every platform, but you always lose something in the trade-off.
Just Started (Score:1)
You can have it now... (Score:3, Informative)
Re:You can have it now... (Score:1)
Swing is very responsive for widgets (Score:4, Insightful)
Swing is not so great in a few other areas. Its canvas drawing abilities can be quite slow. Its document model doesn't handle large documents well. Its table model doesn't handle tables with rows that are various heights.
It is too Fscking Late. (Score:3, Insightful)
It is Java's PERCEIVED performance.
Yes, swing is an ungodly pathetic excuse for a cross-platform GUI. Why has it taken Sun this long to recognize that?
SWT, in all it's glory, I would hope to be the solution. It makes Java feel like something that you'd want to code your apps in. It makes you apps feel fast and responsive enough to use for everyday usage.
Case In Point:
My current client uses PVCS as their version management software. Aside from the sheer stupidity of using something that costs huge dollars, and doesn't provide near the functionality of CVS, the client app is a fucked up Java Swing App.
Now, granted it could be slower, I guess. But God help us, it ain't fast.
It also doesn't use the scroll wheel. Why? 'cause the version of Java that it is coded in didn't support it. *sigh*
The windows don't scroll like native windows. The dropdowns don't feel like native dropdowns. The keyboard accelerators are incomplete and missing.
Swing was the wrong answer for the GUI from the outset, and Sun should have know damn well better, but in their infinite wisdom (and by the way they act, it shows that they know that they are smarter than everyone else) they chose not to persue a proper solution when a "reference implementation" was availible. ( I like that about Sun--Everything of theirs that runs slow as shit, they like to call a "reference implementation" )
Re:It is too Fscking Late. (Score:1)
-Richard.
Re:It is too Fscking Late. (Score:1)
I know, I know, we need to migrate to CVS or something else.
Even Sun admits flaws AWT/Swing (Score:2)
Sun even has the guts to plainly state that Windows GUI techs in C++ and VB are improvements over Java options in the following section:
In addition, many developers noted that the APIs for FocusEvent and WindowEvent were insufficient because they did not provide a way for determining the "opposite" Component involved in the focus or activation change...
Since Microso
Different Strokes (Score:2)
They really both have their place. If you really need an app to look and behave the same across all OS's and
Performance of Java Graphics (Score:4, Interesting)
The fact is, using a recent accelerated graphics card (Quadro4 500 GoGL on a Laptop Dell M50), I have speedups of 10 to 200 times compared to the native Java implementation ON THE SAME PLATFORM. These numbers improve on desktops with GeForce 4 or ATI equivalents.
I am currently improving Agile2D and it is getting better at fonts and most other things as well.
However, Agile2D cannot completely replace Java graphics right now because the repaint management of Swing is not designed to be modified, leading to refresh problems that I haven't been able to fix so far.
This means that -- as Apple already realized -- Java graphics can be made much faster in a portable way by relying on OpenGL.
Of course, on older graphics platforms, OpenGL is slower than software rendering. But using the "Object Technology", it should be possible to engineer two different implementations of Graphics2D and choose the right one at startup time, especially in Java.
So there is hope for large speedups if Sun switches to hardware rendering or redesign a little bit the Swing RepaintManager to allow external developers to implement the speedups by themselves.
A non-Java-dev's point of view (Score:1)
I've never coded in Java, but I've used a lot of programs that were. In my experience, the vast majority of them had dog-slow and butt-ugly UI.
Java might be capable of generating very responsive, pretty UI, but it must not be very conducive to it. Otherwise the vast majority of Java apps wouldn't have such atrocious UI.
If the language isn't designed in such as way so as to encourage good program design and implementational practice, then it's not designed well, IMHO.