Web client for SETI?

Status
Not open for further replies.
Try alt.astro.seti or whatever the general SETI newsgroups are.

My basic take is it probably won't get the reception it deserves.

There's history such that many people will be skittish about this sort of thing.

In particular, you'll note that the SETI@home site liberally repeats the warning that "you must have permission to run SETI@home on a computer" and it is even part of the license agreement.

Folks have also lost jobs for running SETI without permission. This appear to me to be backing into that problem.

I give high points for imagination, though!
 

Hat Monster

Ars Legatus Legionis
47,680
Subscriptor
Umm...it would have to be Java based or something like that. Firstly, even the current CLI client takes over 6 hours and that's on fast TBirds. Since Java is for all intents and purposes an emulated language then I should imagine a Java client to take well in excess of fifty hours on a very fast computer. How many libraries do you know with much over a P2 400?

Why not have your home computer as an FTP server, download the working directory from there, do some crunching, then reupload the directory?

H@
 

theseum

Ars Tribunus Militum
2,879
for many applications, Java may not be as slow as you think... the performence penalty imposed by interpretation can be reduced using techniques like JIT compiling... in fact I remember reading about a project at HP (was it called Tsunami?) where they ran a layer of emulation/optimization under native binaries -- due the optimizations, it was actually faster to interpret than to just run the native binary! That is the premise behind Crusoe, at least...

For a comparison of Java vs C++, check out Ace's Hardware.
 
Hat, almost no one is excited about browser-based applet performance anymore, even though that is in play here.

Besides, unless you're running some old version of Netscape, you probably do have one of the JVMs cited in the article.

The bald truth is, Java's performance has improved noticably, but its old reputation is still out there, fooling people.

I have a different suite of tests I run at work (different than the Tom's Hardware tests) that compare Java and C/C++. The performance differences used to be significant.

Now, it is hard to find cases where Java trails by 2-to-1 and it is quite possible to find cases where Java actually outperforms C. There is still typically a deficit, but I also find a deficit between (e.g.) gcc and commercial compilers that are roughly comparable. The deficit hasn't stopped DC in Linux.

For distributed computing, this could be significant, albeit not necessarily in the context of executing in a web browser which may still have an obsolete (read: slow) JVM in it.

But, the JVM would have to be very obsolete; good performance has been available since level 1.1.8 of most JVMs, which is getting on to 2 years or more ago now. Most people, especially on the server-side, are moving on to 1.2 or even 1.3, where Hot Spot and IBM's unnamed but equivalent optimization strategies, are widely available.

If you're still running some 1.1.2 level JVM in a web browser, and that's your main experience of Java, then you'll certainly conclude Java is still slow. And, a lot of people still do.

However, running as a DC application, where one would presumably access the JVM of one's choice from the command line (CLI style, in other words), then Java should come in pretty good nowadays.

Another issue, which I haven't had time to confirm, is that Java can notice what CPU it is on and take advantage. Compared to some i386-restricted compilation techniques, any JVM can notice and exploit MMX, SSE2, and maybe even 3DNow! if it is present. I don't know to what extent these things are done (especially 3DNow!), but it is certainly possible and much more likely -- there's no downside to doing so.

I personally think a leading reason you don't see Java in DC is sheer momentum, people not understanding what's changed between the two languages, and perhaps most critically of all, the fact that most DC projects rely on "security by obscurity" which is much easier to achieve in C than in Java. Disassembling bytecodes back to pseudo-source is a well-known issue in Java and would make DC security, already fighting with a hand tied behind its back, nearly impossible.

So, until someone figures out how to do real distributed security, you'd end up with a .DLL for each platform anyway to handle upload/download and like issues in what Java calls "native methods" (aka C subroutines it can call). Dealing with just that piece may not be much harder, from a porting difficulty point of view, than doing the whole thing in C/C++ and having done with it, since it involves networking where I have found portability (especially between Windows and Unix/Linux) a larger-than-average pain in the rear. A pity, because the Java bytecodes have the opportunity to exploit the latest hardware floating point technology, CPU-specific instruction scheduling in RISC and probably gain an advantage from those factors alone.
 

Hat Monster

Ars Legatus Legionis
47,680
Subscriptor
Okay Larry, I'd like you to run a FFT routine under a JVM. Lets use Sun's implementation of the JRE. Then try it in compiled C or C++. The C will outperform the java by at least two times. Java is still essentially a JIT language. This requires the interpreter to adjust it's context in real time. No matter what you say or what you do, compiled C/C++ will outperform Java by a long way. Performing lengthy calculations (such as Seti) is not feasible in Java until current CPUs increase by at least an order of magnitude.
JVMs and JITs have improved but at the same time compliers have improved too.

Java CAN exploit 3DNow! or SSE(2) but that would require new JVMs. Do they exist?
H@
 
In at least one case, I have seen Java code beat C on FFT. This was probably not the best C compiler in the world, especially for floating point, but it is at least has proven to be possible. The source code was as close to identical as C and Java jointly permit. I don't have other results handy to see if this is one of the remaining 2-to-1 cases. I wouldn't assume it is, though.

I do iSeries for a living, so I don't keep up with everything that happens in the world of JVMs on Intel (to say nothing of AMD). I would not take my lack of definitive statement on chip specific codegen to mean much.

A quick scan of the net suggests it may not exist yet, at least not for Intel generally. Javasoft hypes doing this sort of thing for SPARC, but if people are doing this for Intel, they aren't bragging about it yet. At any rate, not such that it shows up at the top of web searches. There are hints about it -- Intel apparently has a JVM that does MMX, for instance -- but nothing I can find in the more popular JVMs offhand.

None the less, nothing would be easier than for some of this to slip in, unhearalded, while making ordinary codegen improvements.

While it is true C/C++ continue to improve, they are very mature technologies (Java is getting there, too). That means that Java can be expected to make relative progress for the next couple of years, though not as dramatically as it has been in recent years. I could see that an FFT routine would reach parity eventually, especially in a context like SETI, even versus a better C/C++ compiler than the one I had at ahnd.

The longer code executes, the more Hot Spot style passes that could be afforded. Today, Java makes one low optimization JIT, a Hot Spot improvement JITing and now stops. But, it could go on and spend more cycles doing more exotic stuff reserved for static compiles.

Is there enough of a "market" in high powered Java code for that to happen? If there is, then it is probably true that for the first ten minutes to hour, the Java version will be disadvantaged (I would not expect 2-to-1 however). After that, if the HotSpot type approach was iterative, I don't know why Java would be slower after it invested in the higher power optimizations that it probably avoids today.

In any event, as long as it is 1.5-to-1 or even 2-to-1, Java may still be attractive to smaller projects like G@H. Imagine being able to reach the same machine population SETI can with only a couple of C clients and one Java client.


PS, CPU speed improvements are a red herring here. If C/C++ remains twice as fast, it will remain twice as fast on 1.3 GHz as it does on 667 MHz. I don't see anything coming, off hand, in CPU performance that would differentially advantage Java. Do you?

[This message was edited by Larry Loen on May 13, 2001 at 02:49.]
 

Hat Monster

Ars Legatus Legionis
47,680
Subscriptor
I wasn't being relative with the CPU speeds, Larry. I was just getting the point over that current JVMs would require an incredibly powerful CPU in order to finish a WU in a reasonable time frame.

Perhaps eventually we will get SIMD optimized JVMs (like MMX really makes a difference!) but as of yet we're still not seeing all that many apps that take advantage of SSE or 3DNow! let alone a JVM implementation. If we got a powerful JVM that was able to take advantage of (insert favourite SIMD here) then by all means a Java based DC project would be certainly possible.

As for C/C++ - Java comparisons, I still can't see Java outperforming the compiled languages except in certain small areas much like the Athlon - P4 comparisons until there's some serious work done with the JVMs.

If a Java based and presumably server based DC project did come to light then there'd be the problems of people deploying it on machines they have no permission to do so on. I don't think we'll see any Java based DC projects for this reason if not for the speed reason.

The future of web-based DC is along the line of Clickworkers over at NASA - using the user rather than his CPU. All they have to do is make it less boring!

H@
 
code:<HR>
Code:
As for C/C++ - Java comparisons, I still can't see Java outperforming the compiled languages except in certain small areas much like the Athlon - P4 comparisons until there's some serious work done with the JVMs.

I've been watching this as blood sport for most of the last three years.

Three years ago, I would have agreed with you -- and I told IBM customers the same at trade shows.

The work you speak of, however, has largely been done. And, that's what I tell them now at trade shows.

I've been doing other things of late, but Java has not backslid and has opportunities for further relative improvement, whether bragged of or not.

The worst I can say about Java performance nowadays is that it doesn't do the most expensive of the compiled optimizations (expensive in terms of compile time costs). But, I should also point out that not all shipped code in the world ships at the highest optimization levels either for a variety of reasons (including not knowing how to set them properly for the application at hand).

The nice thing about the JVM is that it can do its optimizations at run time -- so it tends to figure things out without having to do a lot of fancy hand-built settings and analysis by the developer. This buys back a bit versus some of the expensive general optimizations the current JVMs don't do. There are opportunites, as well as problems, with run-time code generation.

Regardless of the details, they are doing something right. You can "not see" it if you wish. I've taken the trouble to measure it. Java is closer than you think.
 
Larry wrote:
In at least one case, I have seen Java code beat C on FFT. This was probably not the best C compiler in the world, especially for floating point, but it is at least has proven to be possible.
I don't think that comparing against a C compiler that may be producing very poor code proves much. When you compile for a DC project you try to use the best compiler available. Sometimes small code generation problems can produce huge performance hits. For example when using double precision floating point on PIII and similar processors if the memory access isn't 8 byte aligned the access overhead is truely horrendous. Some compilers and allocations libraries only align to 4 byte boundaries.
 
Lawrence Kirby wrote:

I don't think that comparing against a C compiler that may be producing very poor code proves much.

True. You'll note I limited my claims. However, when some machines free up, I can make the same comparision against better compilers. Or, maybe, just look up some old results in my office tomorrow.

While I picked a combination most suitable to make the point, it happened to be the machine that wasn't tied up with other things and in a situation with only the one compiler available.

For all the caveats, it is an existence proof that says a 2-to-1 deficit isn't inevitable. Moreover, while the compiler is a bit suspect, it did have good optimization levels turned on. This wasn't against a -g binary.

Even with better compilers, I don't expect to see a 2-to-1 deficit, though FFT might be one of the few remaining such cases. Java may not win, in other words, but I expect it will show up well.

When you compile for a DC project you try to use the best compiler available.

But not everyone knows how to set the compiler options to best advantage. Some people even have folk beliefs like "setting optimization above -O2 risks bad code" and they won't do -O3, much less evaluate -floop_unroll and like things. On modern machines, an excellent compiler with the best compiler optimizations backed off is not going to overwhelm Java.

I see this sort of thing all the time in my job. I don't believe you can assume every SETI port has optimal compiler settings for the highest optimization that could be gotten away with. Ditto other DC projects.

Sometimes small code generation problems can produce huge performance hits. For example when using double precision floating point on PIII and similar processors if the memory access isn't 8 byte aligned the access overhead is truely horrendous. Some compilers and allocations libraries only align to 4 byte boundaries.

I don't know of any compiler and malloc combination that is making that particular mistake today. This has been an issue for at least three years and more, so there's been a transition. Most mallocs now round to an eight byte boundary "just in case" doubles are used in the data structure somewhere. In fact, no malloc available to me does otherwise and I have access to several over several 32 bit platforms. And, the compilers align things intelligently too, for the most part.

Usually, to get bad alignment today, you have to use #pragmas or something. Java, by the way, will not have unaligned data references. Due to its nature, there is no byte-by-byte sequence guarantee for class files as there can be for structs in C and there is no pragma for force "packing" of data. It can do whatever it needs to so that the data is aligned, including reorder fields or add pad bytes. This is one advantage of a pointer-free language.

However, I take your broader point. This may be particularly relevant to SETI in particular since it spends a lot of time in a small bit of code or a small couple of bits of code. There are other applications in the world with such behavior and so the ratio between any two languages (even C++ and C) could hang on some vary narrow details in any particular case. That's one reason my presentations to customers contain lawyer-approved caveats.

Still, if one looks broadly at a suite of programs, it is hard to conclude that 2-to-1 results will be typical, which means, even for applications with a few tight loops, many of them will show a deficit well under 2-to-1, even against a good C/C++ compiler. A few cases will even show Java winning.
 
Nope, don't work for Sun.

If you get me started, I'll start talking about how much better IBM's JVMs are than Hot Spot.

What's of more interest to me is that people seem to be allowing first impressions (Java really was slow way back when) to dominate the story today when, in fact, there has been quite a change over the last several years.
 

Hat Monster

Ars Legatus Legionis
47,680
Subscriptor
Quite a change indeed. I remember Yahoo Messenger's java version crippling my P133 with 80% CPU usage.
In the world of computers if we allowed past prejudices to reign then nobody would buy Athlons!
When Java proves itself as a fast language then I'll be converted. Being platform independent doesn't help most people who are stuck in Wintel land. As things are, precompiled code beats Java.
It does have the potential though, as you have correctly observed a JVM can dynamically recompile according to what it has learned about the program's past actions which a C compiler cannot. This is, incidentally, exactly how the Transmeta Cruesoe works. On boot you get worthless performance and later on (running the same task) you get performance equalling the equivalent MHz Celeron. Not a bad job.

Java has a lot going for it, but for DC not just yet.

H@
 
I checked around at work today.

With better compilers on the C side, Java still wins. (I conclude, in fact, that this particular little benchmark is not very sensitive to optimization, which might be a partial explanation, but also reveals that Java's baseline is not where people remember it was 'way back two or three years ago).

Maybe part of the the explanation is I'm using IBM JVMs (he says partisanly).
 
Status
Not open for further replies.