Slashdot Mirror


Can You Spare A Few Trillion Cycles?

rkeene517 writes "11 years ago I did a simulation of 29 billion photons in a room, that got published at SIGGRAPH 94. The 1994 image, called Photon Soup is here . Now computers are 3000 times faster and I am doing it again only much better, with a smaller aperature, in stereo, with 3 cameras, and with some errors fixed, and in Java. The 1994 image took 100 Sparc Station 1's a month to generate. I need volunteers to run the program for about a month in the background and/or nights. The program is pure Java." Read on for how you can participate in the project.

"The plan is to run the program on a zillion machines for a month and combine the results. All you have to do is run it and when the deadline arrives, email me a compressed file of the cache directory. So email me here and I'll send you the zip file. The deadline will be June 1st 2004.

The running program has a More CPU/Less CPU button. Every half hour it saves the current state of the film. The longer and more machines that run this, the cleaner and sharper the image gets. If you have a lot of machines, I can give instructions how to combine the results so you can send in a single cache directory.

Of course, you will get mention in the article if it gets published."

570 comments

  1. Java eh? by Anonymous Coward · · Score: 5, Funny

    Java eh? So it should run at about the same speed now on modern hardware as it did a decade ago? Chortle.

    1. Re:Java eh? by marcovje · · Score: 1, Insightful

      Wonder why this got modded up Funny.

      It is simply true, and so obvious it struck me immediately too.

      Java for intense computation? Months? Go away :-)

      Nothing against Java, but it isn't suitable for this.

    2. Re:Java eh? by Anonymous Coward · · Score: 5, Interesting

      It depends. If you use Java Objects instead of C / C++ int, then probably yes. If you use Java int instead of C++ int, then the speed is about the same. And you will find absolutely no difference if you need floating point.

      I did quite a lot of C++ and Java programming. At one point, I thought: 'oh, I have now a beautiful and quite fast Java fractal application (mandelbrot), let's convert that to C++ and it will be even faster.'. It was even slower in C++ (probably because of the C++ compiler, Visual Studio). And that was quite a long time back. The link is: http://users.quick-line.ch/thomasm

    3. Re:Java eh? by marcovje · · Score: 0, Interesting


      C++ should be able to run circles around Java.

      And VS is not targeted at numeric work, but should
      be able to outrun Java.

      Of course, if your work is one or two loops inside one method, or one method with e.g. possible tailrecursion, language doesn't matter much, only compiler optimization. I think that happens to your mandelbrot, but that is not typical for scientific calculation.

    4. Re:Java eh? by Anonymous Coward · · Score: 4, Informative

      Ok. My assembly is a little rusty, so bear with me. Let's say we have equivalent Java and C programs. They both have to run on a 386 or higher. (Bear with me. I haven't kept up with the MMX/SSE/SSE2 instructions, so I'll have to fake this a little.) Now, your C compiler will see that you want to store a 32 bit value, but has to generate code for a 386. So, it generates the code:

      pop AX
      STOSW 0x0005
      pop AX
      STOSW 0x0005

      Even though the code may be running on a Pentium Pro (which is optmized for 32 bit code), it's still going to execute those 4 statements.

      Now, the Java Hotspot compiler will start and notice the fact that you're running on a Pentium Pro. So when it converts the bytecode to machine code, it creates the following instructions:

      pop EAX
      STOD 0x0005

      That's twice as fast as the C code!

      Real code would tend to be running on modern processors, so this example is a little contrived. However, the JVM can (and will) use SSE instructions to do multiple calculations in one instruction, while the C code will be forced to generate non-SSE instructions to support the old Pentium Is out there.

      Hotspot is also capable of analyzing the running code and regenerating even better assembly that would perform poorly in other circumstances. For example, let's say Hotspot notices that the bounds can't be exceeded on an array. Well, Hotspot will then recompile to remove the bounds checking.

      Does that explain it better?!

      --
      This post is open source, retransmit as desired.

    5. Re:Java eh? by Viol8 · · Score: 1, Informative

      "Now, your C compiler will see that you want to store a 32 bit value, but has to generate code for a 386. So, it generates the code:"

      Compilers are quite capable of finding out or being told what architecture to compile for and this includes various x86 types. Sorry , but your argument is invalid.

    6. Re:Java eh? by Anonymous Coward · · Score: 1, Informative

      The parent is funny because exaggeration is funny. Java isn't really slow anymore. Most of its slowness is attributed to load times, but that's the price for garbage collection and the like. When it comes down to it, Java can get things done. C is still faster in most cases, no doubt, but with today's processors, a mouse could starve on the difference.

    7. Re:Java eh? by TheLink · · Score: 4, Informative

      His argument isn't invalid.

      rkeene517 is asking for volunteers to run the program. If rkeene517 does it in C/C++ then rkeene will have to compile for the different x86 types and ensure that volunteers download the right binary. From experience you end up getting a high number of people getting the generic x86 binary instead of the optimized one because in order to avoid zillions of support queries, you have a "If you are unsure, click on i386".

      Of course you could bundle all the various binaries and add code or a binary that figures out what x86 it is and runs the relevant binary.

      But that involves a step more than what you suggest.

      --
    8. Re:Java eh? by GlynDavies · · Score: 4, Informative

      His argument is quite valid.
      Sure, you can configure compilers as narrowly as you like, but in most cases, compliation will be targeted at the lowest common denominator.
      If your compiling for yourself, you have the luxury of building for your own CPU. This isn't the case here.
      Why do you think Linux binary rpm's, for years, were compiled for 386 chips. It's only recently that some (all?) distributions have started distributing 586 based rpms.

      The point is, Java can make this decision at run-time, and hence target the actual CPU. C++ code can not (without a lot of pain, at least).

    9. Re:Java eh? by Anonymous Coward · · Score: 1

      Either I'm suffering deja vu, or this has been posted nearly verbatim before in a previous discussion of Java vs. C.

      Not only that, Face the Facts (770331) 's last three or four posts are word-for-word copies of other people's posts, copied from anti-slash.org's "database tool".

      Note only that, but anti-slash.org has posted links to his posts, asking their members to mod him up, with the notation "another karma whore account" -- which implies he's karma whoring in order to get mod points in order to troll.

      (Implies but doesn't prove: anti-slash.org at one point asked its members to mod one of my posts up, why I'm not sure.)

      But whatever Face the Facts (770331)'s motivations, his posts are plagiarism and he's a plagiarist, apparently not talented enough to write his own posts.

      Mod him down.

    10. Re:Java eh? by AllUsernamesAreGone · · Score: 4, Insightful

      This is true for pure number crunching where you spend a lot of time in loops.

      Java is quite good at that.

      Now, try writing a real application. One with an interface, one that does real work and spends most of its time interacting with a user rather than banging numbers. Run the test again and you'll find that C++ is significantly faster than Java in this situation because Swing is slower than arthritic snail carrying a small planet and Hotspot isn't good at optimising the sort of stuff a general program has to do.

    11. Re:Java eh? by tolan-b · · Score: 2, Informative

      Use SWT instead of Swing and you won't notice any difference (on mac and windows) and little difference on GTK (they're working on it ;)

      Startup time is still an issue, but for most apps it's not much of a problem.

    12. Re:Java eh? by PIBM · · Score: 1

      I don't know how it would be faster to have C++ code that run in circle compared to a Java code that compute the solution..

    13. Re:Java eh? by Anonymous Coward · · Score: 0

      the STOSx instructions take no operands. They store AL|AX|EAX to [E]DI. Use the REPeat prefix to do it [E]CX times.

    14. Re:Java eh? by Anonymous Coward · · Score: 0

      Dude, is your C compiler that bad? I like Java a lot, and use it for compute intensive applications, but I think you're either pretty bad witha c compiler or trolling. if you're doing something CPU intensive in C, you need to use gcc -O2 (or -O3, depending), with -march=cputype. This will allow gcc to generate exactly the same code you just described, since it is not limited to 386 instructions. And if you need even more performance, you can just use Intel's C compiler for a lot of things (non-commercial is free as in beer), though it doesn't support some GNU extensions and I think has trouble with some things like the Linux kernel.

    15. Re:Java eh? by tap · · Score: 3, Insightful

      It seems like your trying to say that the C compiler must produce 16 bit code for a 386, but the java JIT compiler will produce 32 bit code.

      The problem with that is that the 386 is 32 bit! You're comparing a C compiler making 16 bit code for a 286 to a java compiler for a 32 bit platform. Unless you know of a java runtime that works on 286 or worse processor, that's not a fair comparison.

      It's still silly anyways. Compilers can produce code tuned for different CPUs. There is no need to compile for the lowest common denominator. When I compile scientific programs at work, I sure as hell don't compile for a 286. I don't even have a compiler than can produce 16 bit code! I always tune the compile for the specific CPUs.

    16. Re:Java eh? by Anonymous Coward · · Score: 1, Informative

      Use JDK 1.4 or 1.5 on Windows and use
      the RC1 of the Blackdown JDK 1.4.2 on Linux and then revert your statement :-)

      Over here on my machine pure Swing on Blackdown 1.4.2RC1 is faster than GTK2 but a tad slower than Qt.
      On Windows there is no noticable difference between Swing and native Controls anymore speedwise.

      Both use hardware acceleration functions of the underlying graphics card, so no big deal here anymore.

    17. Re:Java eh? by Viol8 · · Score: 0, Redundant

      A compiler is a compiler. It wouldn't be hard to implement a JIT C/C++ compiler. Just knock up a short shell script to compile the source before you run it. Like I said , his argument is invalid.

    18. Re:Java eh? by markbthomas · · Score: 2, Insightful

      Of course SWT is faster than Swing. SWT interfaces to the native toolkit, which is, of course written in C or C++. In Java, the only fast method is a native method.

      I've still yet to be shown an example of a Java program that runs faster than an equivalent C or C++ program, whereas I've had a wealth of experience with things being around the other way (one extreme example was Java: 8 hours, C: 30 seconds).

      The Hotspot argument is hot air, since the time you spend re-compiling the whole program (JIT of course, which is closer in actual behaviour to JustTooLate) will in most cases outweigh what tiny improvements you can get in the part of the program that matters for performance. Remember that 90% of CPU time is spent in 10% of the code.

    19. Re:Java eh? by gauchopuro · · Score: 3, Informative

      Sure, it's hard to do by hand. But I know of at least one compiler (Intel's C++ compiler) that can generate multiple versions of assembly code and dispatch on processor type at runtime. That compiler is much better than Visual Studio for numerical computation.

    20. Re:Java eh? by tolan-b · · Score: 2, Interesting

      I don't think Java will often be faster than C++, the point is that for a lot of things it needn't be noticeably slower. Yes SWT is native, but that's only one component, GUIs really are better in native code. Swing (or is it AWT? I've never used either) is native too, it's just built into the JVM instead of being separate.

      I know you've probably heard it before, but try Eclipse on Windows or OSX, bar the startup times, I find it indistinguishable from a native IDE.

    21. Re:Java eh? by diegocgteleline.es · · Score: 1

      What about the time hotspot wasted to determine that that optimizacion was necesary? I'm sure it wasn't free...

    22. Re:Java eh? by essreenim · · Score: 1

      When are you going to learn.
      The Java interpreter compiles nearly everything into highly optimized native C code in the end anyway.

      As ususal, people are getting the argument completely wrong.

      When it comres doen to it its a race between group 1 who download the generic 386 binary
      to run because they dont know what to pick VS. a java program that will pick the right one for you and compile almost everything into Sun native c binary. I know what I would pick!

    23. Re:Java eh? by gaj · · Score: 1

      Hotspot doesn't compile the "whole program". It compiles those methods that run sufficiently many times to be worth compiling. Still not as fast as native compiled code, but for long running programs, it can be very, very close. And for a program like this one, it is perfect: he can get participation from Linux, Linux64, LinxMPC, Solaris, Solaris64, SolarisX86, Windows95/98/NT/2k/2k3/XP/64 (er ... strike that last one), Mac OSX, and AIX, at the very least, from one executable. And, as an added bonus, his code can be multithreaded and automagically take advantage of multiple CPUs on most of the above.

    24. Re:Java eh? by essreenim · · Score: 2, Insightful

      Dammit this is infuriating!
      Stop comparing java to c, it s so.. last decade!
      Sun have excellent c compilers. Thats really all Java is these days. Its a load of stack instructions that are completely platform neutral.
      that are optimized according to the particualar target platform and translated into c binary.

      This translation is often worth the cost because of the optimizations gained.

      If you cannot understand this, then you will not grasp why J2ME CDC/CLDC is generally the preferred solution for mobile communication and embedded software....

    25. Re:Java eh? by heinousjay · · Score: 0, Flamebait

      Just knock up a short shell script to compile the source before you run it.

      That would be so much faster than Java, it astonishes me. Truly, you have a dizzying intellect.

      --
      Slashdot - where whining about luck is the new way to make the world you want.
    26. Re:Java eh? by BenTels0 · · Score: 1

      *Sigh*. Are we ever going to see the end of this bullshit? No, probably not.

      Look, try to follow along (I'll leave a dotted line, it shouldn't be that hard). Speed of execution doesn't depend on the language. It depends on how the implementation was written, the sequence of machine instructions that is generated from the source code and (in case an intermittent machine such as a JVM is used, or in case of parallellization) how that code is executed.

      A modern JVM incorporates at least a JIT compiler and probably the newer HotSpot generation compilers. These compilers do not translate bytecode over and over again, line by line, into native instructions. These compilers translate large chunks of the code and leave that code in memory as long as possible for execution. That in turn means that once the JVM is started (JVMs in normal execution mode usually do suffer from ridiculous startup times) and the code to be executed is translated, a program originally written in Java incurs no particular lag time in execution in comparison to an equivalent program written in C, C++, Pascal, APL, Fortran or any of the other languages you care to mention that are traditionally compiled to native code.

      The only question then is whether the program was written in such a way that it does a lot of memory allocation and reallocation during the actual calculation or not. These are the considerations that rule the average execution times of a program, not which language it was written in.

    27. Re:Java eh? by BenTels0 · · Score: 1

      That time only has to be expended once. Whether or not that effort is significant with respect to the entire calculation depends on what the calculation is.

    28. Re:Java eh? by BlackHawk-666 · · Score: 4, Insightful

      If this is true then why is Java so goddammed slow still? Why is it every medium sized or above Java app I've used performs like crap compared to a similar one compiled in C++ or simlilar languages? It just seems to me there is a major disconnect between what the Java adherants are claiming and the reality I am faced with every time I use a Java app.

      --
      All those moments will be lost in time, like tears in rain.
    29. Re:Java eh? by BenTels0 · · Score: 1

      C++ should be able to run circles around Java.

      No, it shouldn't. One language is not generically faster than another language, ever. Trust me, there is not a problem out there for which you cannot write a Java program that is at the very least reasonably fast and a C(++) program that is so slow that glaciers are speed monsters by comparison.

      And VS [...] should be able to outrun Java.

      Leaving aside that you are now comparing a set of compilers to a language (which is a pointless comparison), this statement is as inherently flawed as the previous one -- for the same reason.

    30. Re:Java eh? by MicklePickle · · Score: 1

      The good thing with coding in Java, is that now it doesn't JUST support PCs, I could run this on our 90 odd HPUX/Solaris/Linux servers at work. By coding in Java you instantly broaden your server base. Heck run it on a Cray, (if it has a JIT). That alone surely makes up for any slowness that may be apparent in Java.

      --
      -- main(s){printf(s="main(s){printf(s=%c%s%c,34,s,34) ;}",34,s,34);} $p='$p=%c%s%
    31. Re:Java eh? by operagost · · Score: 1

      Your JVM sucks. There's one possible reason.

      --

      Gamingmuseum.com: Give your 3D accelerator a rest.
    32. Re:Java eh? by Suidae · · Score: 4, Interesting

      I don't know why Java is so slow, but I wonder if it has something to do with memory requirements/managment?

      All the Java apps I use that are not trivial tend to eat at least 100Mb of ram, and sometimes several hundred. They also tend to stomp all over my poor CPU, which, at 500-1000Mhz, really ought to be fast enough for most things (seriously, I'm not trying to crunch SETI data or crack an RC5 key here).

      I attribute most Java slowness to poor programming techniques. Its got to be, since Java programmers are always telling me how fast the code really is; it must just be that most Java coders are so crappy that they drag that blazing fast JVM to its knees.

    33. Re:Java eh? by 42forty-two42 · · Score: 2, Insightful
      the C code will be forced to generate non-SSE instructions to support the old Pentium Is out there.

      gcc -msse -msse2 -mfpmath=sse -march=pentium4 -O3
    34. Re:Java eh? by BenTels0 · · Score: 1

      I've still yet to be shown an example of a Java program that runs faster than an equivalent C or C++ program

      And what unholy twist of the mind would lead you to expect two equivalent programs to have a significant speed difference? If anything, I'd expect two equivalent programs to have more-or-less the same translation into machine-level instructions. Which means the same order of calculation time for the same problem instance.

      one extreme example was Java: 8 hours, C: 30 seconds

      Which leads me immediately to doubt how "equivalent" your programs were. When it comes to order-comparisons or pure benchmarking, "equivalent" does not simply mean "produces the same result as". You have to compare the same algorithm over the same data structures.

    35. Re:Java eh? by arkanes · · Score: 1

      On my lower end work machine (900Mhz p3, 512megs of ram), eclipse, argus, C++ Builder X and all the other Java apps I use are noticably slower than my other preferred IDEs, like VS 6 (2003 is a pig because of all it's stupid com dispatch). On my more powerful home machine (Athlon 1900+, 512 megs of ram) the difference is harder to see, only really comes up when it's been swapped out (working set for all these apps includes the app + the jvm, so theres alot more data to read out of swap). Startup times are a bitch for all of them, but in fairness I can live with that.

    36. Re:Java eh? by j-turkey · · Score: 1
      Sure, you can configure compilers as narrowly as you like, but in most cases, compliation will be targeted at the lowest common denominator. If your compiling for yourself, you have the luxury of building for your own CPU. This isn't the case here. Why do you think Linux binary rpm's, for years, were compiled for 386 chips. It's only recently that some (all?) distributions have started distributing 586 based rpms.

      Sounds like many people are forgetting -- this is what a lot of people do (in part) with a makefile. Identify the architecture and pass flags to the compiler to optimize for said architecture. Sure, it has to be tested -- but it's not like Java code doesn't need to be tested on all platforms it's being used on.

      --

      -Turkey

    37. Re:Java eh? by sydlexic · · Score: 1

      Because Swing is a bloated monster that doesn't benefit from direct OS assistance/integration (either in the kernel or windowing system). But Java on servers can be very, very fast and scalable. I have years of coding and benchmarking Java server apps to back that up.

    38. Re:Java eh? by Atzanteol · · Score: 1

      I believe it's only able to be *faster* in tight computational loops. From the sounds of it this is where the JIT can do a good job. Startup time for any Java app is ass. Memory allocation speeds seem like ass as well. Any application that doesn't perform the same thing over and over again performs like ass.

      And all the while everything is running, it consumes RAM like it's going out of style. Adding to the entire system now feeling like ass.

      --
      "Ignorance more frequently begets confidence than does knowledge"

      - Charles Darwin
    39. Re:Java eh? by BenTels0 · · Score: 1

      One with an interface, one that does real work and spends most of its time interacting with a user rather than banging numbers. Run the test again and you'll find that C++ is significantly faster than Java in this situation because Swing is slower than arthritic snail carrying a small planet and Hotspot isn't good at optimising the sort of stuff a general program has to do.

      Again, that depends mightily on exactly HOW you write that Swing interface. I'll grant you, it's a lot easier to get it wrong in Java than it is to do so in many other languages -- the native-library-versus-drawn-internally aspect can start to weigh, as can the internal translation aspect. However, it is far from impossible to write a Swing application that is as snappy in response as any equivalent program that was natively compiled (from C++ or another language). Or, of course, faster than the native code if you have a "native programmer" dumb enough to rely on "C++ being so fast" to compensate for his producing slop instead of code.

      I'll even give you two examples. One a "large" application, one from a small piece of software I developed myself.

      The first example is my experiences in using the Rational Rose UML modeling tool versus the 100% Java MagicDraw modeling tool. Both allow full modeling using all UML diagrams, provide full standards support and a host of related development tools (two-way engineering, etc.). The version of RR I used was written by the "native programmer" idiot type I described above. It started rapidly, brought up a nice empty screen and turned into molasses going uphill in January through a funnel the moment I put a single class entity in my diagram. By comparison, I have never seen any verson of MD behave as anything less than a highly responsive, native-speed look-alike tool even when handling larger models with several diagrams and lots of entities.

      The second example is a small program I wrote to accompany my master's thesis. It included a speciality parser and a graph component (not written by me) that I used to display the resulting tree during my defense. I was struck at the time that the interface responded to commands with very nearly the same speed as I would expect from a native application, the difference being no more than a fraction of a second each time -- a lag that I contributed wholly to the fact that I was running the program remotely over the Internet, the interface being pumped in through the X Windows protocol (or possibly through a VNC connection, I don't recall). No local client for the program was involved, in case you're wondering.

    40. Re:Java eh? by BenTels0 · · Score: 1

      I attribute most Java slowness to poor programming techniques. Its got to be, [...]

      You can stop wondering, it is. Be it Java or be it not, you wouldn't believe some of the crap that is produced and passed off as "code" nowadays.

    41. Re:Java eh? by Short+Circuit · · Score: 1

      If you're writing a JIT-style runtime, you have a couple of options. First, you could compile the whole thing to native code when you start the application. This might be OK for small apps, but for large jobs such as a Java implementation of WordPerfect, it'll take a long time. (Comparable, I suspect, to compiling the gcj runtime.)

      The second option is to compile bytecode you encounter to native code, when you encounter it. This means that highly-used code will see the most improvement, but periphery code will actually seem to slow down. A large, complex app, especially if it has a GUI, is going to see serious performance issues if it has a lot of features that are typically only used once or twice while the program is left running.

      If you leave the application running for a long time, the features you've already used will have been compiled to native code, so a speed improvement might be noticable. (I say might, since to the user, the overall improvement will have been so gradual that they may not have noticed the change at all.)

      However, for small jobs like this scientific number cruncher, your application is small and you'll see a significant improvement in the rate at which numbers are crunched, over a very short period of time. In addition, he's talking about running these applications constantly for an amount of time that would be rediculous if you were talking about a larger application like WordPerfect or Eclipse.

    42. Re:Java eh? by markbthomas · · Score: 1

      Same algorithm, same data structures.

      It was a discrete event simulation exercise for a simulation and modelling course at university, based on a very simple algorithm:

      • Take an event off the head of a queue.
      • Process that event depending on its type, parameters and the current state of the simulated system according to a specification we were given as part of the exercise. This modifies the state of the system and generates new events that will happen in the future.
      • Insert the resulting future events into the queue.

      There were dozens of Java implementations by various students of differing capabilities, and one of them written by the professor teaching the subject as a reference implementation. My C implementation beat all of them and then some. In fact, the Haskell implementations from the previous year did too (and they were run interpreted, not ghc-compiled).

    43. Re:Java eh? by tolan-b · · Score: 1

      What OS is that on? Because my 800mhz system running GTK eclipse is significantly slower than my 900mhz windows box running eclipse.

      GTK SWT has some catching up to do.

    44. Re:Java eh? by Too+Much+Noise · · Score: 1

      That will use the SSE2 unit in scalar mode. you have to code by hand any vector mode operations as gcc does not have support for that (icc does though, although there are still plenty of cases where 'by hand' does it better :-) One point to that is data alignment - efficient load/store ops require aligned data; with non-aligned data the penalty is rather large (that's supposed to improve in SSE3 though).

      I would be curious to know whether any JIT uses the SSE2 unit in vector mode. That would be an improvement over gcc.

    45. Re:Java eh? by stephenisu · · Score: 2, Insightful

      and what if the user can't compile for some reason?

      Yes we know it CAN be done, but what is the PRACTICAL solution?

      --
      Sigs? We don't need no stinking sigs!
    46. Re:Java eh? by Anonymous Coward · · Score: 0

      My joke was not meant to be taken seriously.

    47. Re:Java eh? by BlackHawk-666 · · Score: 1
      One of the Java IDE's I tried to use was so slow it would drop keystrokes on my machine. Whenever I hit f s it dropped the f part and would just insert the letter "s" into my document. Not quite the effect I was after.

      I might give Java another shot at server related tasks since you're so confident it is fast enough for these tasks. The premise of Java is just so tasty, it's the implementations that have been left wanting in my experiences.

      --
      All those moments will be lost in time, like tears in rain.
    48. Re: Java eh? by alw53 · · Score: 1, Informative

      I really hate to pollute this wonderful discussion with actual facts, but this issue has actually been studied and numbers are available:

      "An Empirical Comparison of Programming Languages

      Lutz Prechelt, An Empirical Comparison of C, C++, Java, Perl, Python, Rexx, and Tcl.

      80 implementations of the same set of requirements are compared for several properties, such as runtime, memory consumption, source text length, comment density, program structure, reliability, and the amount of time required for writing them. The results indicate that, for the given programming problem, which regards string manipulation and search in a dictionary, "scripting languages" (Perl, Python, Rexx, Tcl) are more productive than "conventional languages". In terms of run time and memory consumption, they often turn out better than Java and not much worse than C or C++. In general, the differences between languages tend to be smaller than the typical differences due to different programmers within the same language."

    49. Re:Java eh? by Jerk+City+Troll · · Score: 1

      Thank you for a well-written post. It's such a shame that so many people argue Java performance without even understanding how the damn thing works. (It's funny that at the present, you have to explicitly turn off native execution via the -Xint flag.)

      More people need to read the Hotspot Whitepaper before they open their mouths.

    50. Re:Java eh? by sp00j · · Score: 1

      In our server-based Java apps, it's always the garbage collection that kills us. We ended up spending a few weeks fiddling with all of the various JVM garbage collection settings to find a one that caused the least amount of harm. When you start re-writing your code so that the garbage collector doesn't affect you as much, you start wishing for a platform (oh, C/C++) where you have far more control over such things...

    51. Re:Java eh? by Thorgal · · Score: 1
      This isn't exactly true. As the author of global illumination renderer I witnessed many situations where FP code in Java just sucks. This is especially the case for trigonometrical operations, where implementations in JDKs >= 1.4 return bit-for-bit identical results on all platforms. This is achieved with math library, thus wasting the potential of direct computation with FPU. This is also the reason why some half-baked benchmarks concluded that with JDK 1.4 Java become much slower, while in fact it is definitely faster save for these FP operations.

      BTW, this is a good time to plug my Java app benchmark based on the renderer I wrote: JatMark.

      --
      "Man in the Moon and other weird things" - wfmh.org.pl/thorgal/Moon/
    52. Re:Java eh? by dup_account · · Score: 1

      Poor coding style. Like realizing the entire UI on startup. Needless looping, needless going to the database or disk, memory wasting, using improper data structures and object models. The list goes on and on.

    53. Re:Java eh? by notsoclever · · Score: 1

      Or he could provide the source so that PowerPC/SPARC/Alpha/etc. users can join in too.

      --
      There are 10 kinds of people: ones who understand ternary, ones who don't, and ones who think this joke is about binary
    54. Re:Java eh? by Deraj+DeZine · · Score: 1

      This is a repost: of this comment. His argument is moot for people that use something like GCC to generate ELF binaries that compile code for multiple x86 architectures and execute the best one at runtime.

      --
      True story.
    55. Re:Java eh? by Brandybuck · · Score: 1

      Sure, it has to be tested -- but it's not like Java code doesn't need to be tested on all platforms it's being used on.

      People test Java code on platforms other than the one the developer uses? This is so counter to my experiences that I find I'm having serious problems believing it.

      --
      Don't blame me, I didn't vote for either of them!
    56. Re:Java eh? by John+Courtland · · Score: 1

      Garbage Collection, self memory management, etc... Things that, in a critical app that is speed dependant, should be determined by the programmer, not the interpreter. Extra cycles on every memory allocation and logic to determine when variables can be safely freed. No sir, I don't like it.

      --
      Slashdot is proof that Sturgeon's Law applies to mankind.
    57. Re:Java eh? by Anonymous Coward · · Score: 0

      Note:
      Before modding, scroll the page down a bit, look for similar posts and replies to them. If there are links in them (to slashdot, not goatse, silly), check them out as well.

      The next lesson will be about RBL.

    58. Re:Java eh? by The+Unabageler · · Score: 1

      the reason java is preferred for mobile and embedded solutions is that there is a larger base of cheap java programmers than there are C/C++ programmers. Mobile and embedded solutions are produced by corporations, for the fast moving consumer market. cheap and fast work is much better than expensive but reliable in this case.

      --
      perl -e '$_="\007/4`\cp%2,".chr(127);s/./"\"\\c$&\""/gees; print'
    59. Re:Java eh? by Anonymous Coward · · Score: 0

      C/C++ reliable? Hahahahahaha!

      Economically speaking, it is faster and cheaper to develop server applications in Java than C/C++ one. On the production point of view, Java applications are far more reliable than C/C++. Speed? Ah yes speed! If it is not suficiently fast, buy a bigger machine.

      Concerning the GUI, I use HTML.

    60. Re:Java eh? by JWSmythe · · Score: 2, Interesting

      I've done some tinkering in Java. I don't *LIKE* the language, but that's another story.

      You're fairly close on the poor programmers. I was writing a java applet to handle streaming video for users (display in the browser). I wrote something myself, which ran ok. I also downloaded, decompiled, and read several other people's works. None of them worked very well, but they were what was available at the time (this was several years ago). I ended up taking his applet, and rewriting it. In the end, there was nothing left of the original program, but it gave me interesting design ideas.

      So by the time I was done, I had an applet that was fairly quick, and worked pretty well on x86 (Windows and Linux). Users reported that it worked on other *nix's also. Then came in the Mac complaints.

      It took a couple weeks to work it out so it would work as expected on the major platforms. It would still crash random people's browsers, or even their whole machines, but it wasn't reproducable on any of our machines, even with the same os and browser versions as they had.

      In the end, I spent another day writing a cute chunk of javascript, which did the same job *MUCH* more efficently. It worked on every browser that supported JavaScript with almost no exceptions (like, none I can think of, but...). The JavaScript was much smaller, and much faster, to do the same job.

      I don't write in Java any more. Well, I guess I could, I just don't. Looking at other people's Java work, I don't see much use into getting back into it. Their applications do hog much more of the machine than they should. If they work, they're fine, but the odds of getting a particular application to work on a particular platform are slim, unless you're using the specific platform that it was written for.

      One case in point was a java program written on RedHat 7.3, using IBM's distribution of Java (I think) and IBM DB2.

      Try tried to run it on RedHat 9 with Sun's Java, and IBM's DB2. It would run for about a day and then crash. Not much good for a production web site, right?

      They tried various combinations, and finally ended up with an older RedHat, with an older version of Java. Write once, Run everywhere, failed.

      --
      Serious? Seriousness is well above my pay grade.
    61. Re:Java eh? by StarCat76 · · Score: 1

      Amazing thinking! Now your application only runs on P4's! No P3's, no P2's not AMD Athlons, just the P4. I bet your customers will be thrilled to hear that they have to upgrade their processors to run your software.

    62. Re:Java eh? by BenTels0 · · Score: 1

      Same algorithm, same data structures.

      Given that this was an exercise, I'm somewhat tempted to ask whether you aren't counting the JVM startup time on top of a very short problem instance.

      That, or whether the exercise involved lots of dynamic creation of objects (in which case your program was by definition not doing the same thing as the Java implementations). The exercise you mention sort of sounds like that.

      In fact, the Haskell implementations from the previous year did too (and they were run interpreted, not ghc-compiled).

      I am well aware of the forte of Haskell and its different interpreter implementations. To the degree that I wouldn't be surprised if the Haskell implementation did better than your C implementation.

    63. Re:Java eh? by BenTels0 · · Score: 1

      Sorry.

    64. Re:Java eh? by Fulcrum+of+Evil · · Score: 1

      Now, the Java Hotspot compiler will start and notice the fact that you're running on a Pentium Pro. So when it converts the bytecode to machine code, it creates the following instructions:

      pop EAX
      STOD 0x0005

      Why can't I run that on a 386? It's not like they don't handle 32 bit words or anything.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    65. Re:Java eh? by Anonymous Coward · · Score: 0

      The code you showed would be generated by extremely old C compilers (which were in prevalence while the 80386 was *FIRST* shipping.) By the time the 80486 was shipping, 32bit compilers which leveraged the 80386's original 32bit instruction set became widely available.

      Since that time, Intel has released the Pentium, Pentium Pro, Pentium II, Pentium III and Pentium IV processors, and 16 bit compilers have basically stopped shipping as serious products (with even the lagging Microsoft finally joining the "32bit revolution" in the mid to late 90s.)

      All compilers today can reasonably assume that all x86 processors available today can run the Pentium II instruction set. With the exception of the SSE class of media instructions and some of the oddball hyperthreading instructions, there is no difference between the Pentium 4, Athlon, or Pentium II instruction sets. Your comment may apply to the new AMD64 instruction set, however you would have to show me raw data on that (that a JIT VM exists for AMD64 and that a *competitive* 64 bit C compiler is not available) before I would conceed your point.

      There is no run time process of low level optimization techniques available to JIT compiling enabled VMs that don't exist in a more general form in off-line C compilers. This is regardless platform considerations. Java's best bet is to find higher order optimization from its somewhat higher level of abstraction. But even there, Java has not been convincing in terms of performance versus, say, C++.

    66. Re:Java eh? by markbthomas · · Score: 5, Informative

      Given that this was an exercise, I'm somewhat tempted to ask whether you aren't counting the JVM startup time on top of a very short problem instance.

      C: 30 seconds, Java: 8 hours. No kidding. These were running on the same laboratory machines, the Java programs using the latest Sun JVM at the time. The exercise involved calculating some statistics from a simulation run for one virtual year. Most of the people doing the Java version had to leave it running overnight. Besides, JVM startup time is a performance issue, you can't just dismiss it out of hand.

      That, or whether the exercise involved lots of dynamic creation of objects (in which case your program was by definition not doing the same thing as the Java implementations). The exercise you mention sort of sounds like that.

      In the Java version, each event was an object. In C each event was a malloc'd struct. These are analagous in that they are the correct way to solve the problem in that particular language. The fact that object creation and destruction is a lengthy process is an important reason why Java is so slow. It's an object-oriented language, its raison d'etre is to create and destroy objects. If it can't do that fast enough then what's the point in it being able to do anything else with speed?

      I know at this point the Java apologists will say "just use a pool of pre-created Objects, that'll speed it up". This misses the point in two ways: (1) Java was supposed to obviate the need to perform manual memory handling. Now I have to not only remember to de-allocate my objects when I am done with them, I have to write a Pool class within which to store my not-currently-in-use objects?! (2) I can do that in C, too, if I really want to, and it'll make the C version faster again.

      I am well aware of the forte of Haskell and its different interpreter implementations. To the degree that I wouldn't be surprised if the Haskell implementation did better than your C implementation.

      They didn't. I was told they took around 10 minutes to run, but I never actually saw them working. When I produced results from a simulation that ran for 1000 years (an overnight run for my C program), the professor was amazed. But yes, in my experience interpreted Haskell is very fast, which makes Java look even more foolish.

      I've done this four times now; written a C equivalent of a Java program and found it at least one, often several orders of magnitude faster. I've yet once to be shown a Java program that is significantly faster than its C equivalent.

      This does not mean that Java should not be used as a programming language. The language features (especially those in version 1.5) are useful for working in a collaborative environment with mediocre programmers, and where the raw performance of the application is not critical (such as a GUI front-end to a server application). Just don't bullshit about it being faster than C, or even "fast" and expect me to believe it.

      I'm willing to be proven wrong, but until someone can actually show me proof that it can be done, I'm not going to believe the hype, hand-waving and hot air.

    67. Re:Java eh? by Anonymous Coward · · Score: 0

      Ya, it explains alot it seems that the java application is spending most of it's time generating fast assembly code rather than executing it.

    68. Re:Java eh? by Anonymous Coward · · Score: 0

      If your post is open source, does that mean we get to see your brain?

    69. Re:Java eh? by Anonymous Coward · · Score: 0

      Poor programming is only a small part of the problem.

      Java's text and graphics rendering are incredibly slow. I wrote a PDF parser and rendering engine in Java. The main rendering code boiled down to a loop over a vector of strings, all drawn with the same font. A screenful of text took about 1-1.5 seconds to draw, depending on how much actual text was on the page.

      I tried the same thing with a rendering library in C++, and it was over 10 times faster. You can also just look at the performance of Acrobat Reader so see fast text rendering.

    70. Re:Java eh? by markbthomas · · Score: 2, Informative

      What's worse about swapping a large* Java program out and back in is when the garbage collector next runs, usually very soon after it gains focus (i.e. when you want to use the program again), it touches near enough every damn page the program is using, checking for objects to cull. This causes the OS to swap the *whole* program back into memory and consequently a whole load of thrashing.

      [* is there any other kind? ;-) ]

    71. Re:Java eh? by Trinition · · Score: 1

      To be complete, it's not Java 1.4.x that's slow, it's Sun's implementation. java.lang.Math is generally faster, but does not produce identical results on all platforms. If you want identical results, you have to use java.lang.StrictMath. However, their documentation points out that some of the Math routines simply call StrictMath (my guess is the trig routines fall into that category, for example).

      Thus, it's Sun's laziness to not provide a full "fast" implementation of Math that leads to the slowdown of FP. Perhaps other library implementations handle it better?

    72. Re:Java eh? by Thorgal · · Score: 1

      Your description is true, but the cause for that cannot simply be laziness, as Sun JDK 1.[23] contained much faster implementations of trigonometric routines in java.lang.Math. They removed them for some reason, but I never found out what it was.

      --
      "Man in the Moon and other weird things" - wfmh.org.pl/thorgal/Moon/
    73. Re:Java eh? by Scooter · · Score: 1

      Hmm but surely the Java setup is also running the compilation process at run time (from bytecode to machine code)? Surely that takes up more cycles than it saves by the on-the-spot optimisations?

      Or does the run time environment "cache" the compiled machine code and so run quicker the 2nd time around?

    74. Re:Java eh? by TheSunborn · · Score: 1

      Yes we do. And then we find out that they way swing layout JComponents changed from 1.3 to 1.4 so we need to insert ugly things so support java v1.3 which were needed due to the need of mac support. (Java 1.4 was in beta for MacOS X at the time, so we could not just tell people to upgrade)

    75. Re:Java eh? by XaXXon · · Score: 1

      BTW, not all 386's were 32-bit. I'm not sure what the exact details are, but only the 386DX was a full 32-bit chip. The 386SX had significant 16-bit parts.

      This is why Linux requires a 386DX or better. It is not because Linux requires a math coprocessor (which the 486 SX -- which is fully supported -- doesn't have)

      Now before someone tries to say otherwise, the 386 SX/DX letters mean something far different than the 486 SX/DX numbers. 486 SX didn't have a math coprocessor (or it was disabled) whereas the 486 DX did. NO 386 chips had a built in math coprocessor. You had to add a 387 chip on the motherboard. 486 SX chips could not be upgraded to to have a math coprocessor. There was no such thing as s 487 coprocessor (I'm 95% sure on this last bit)

    76. Re:Java eh? by tap · · Score: 1

      The 386SX could still run 32bit code. It had a 16 bit data bus, and fewer address lines as well I think. But it could run Windows/386 (remember that?) and use "386 Enhanced mode", while a 286, which was both cheaper and faster than a 386SX, couldn't.

    77. Re:Java eh? by angel'o'sphere · · Score: 2, Interesting

      Well,

      Eclipse might be indistinguishable from a native Application. For me it is not. A SWT application has the typical SWT look just like a Swing application has the typical Swing look.

      I have my skins set to Win95 style(on windows), for me a Swing application looks very windowish ... there are differences, but the ordinary user won't notice it. Just as you claim not to notice the SWT differences to the native OS widgets.

      Regarding speed ... what good is an IDE where the GUI is some 1/1000 seconds faster than a compareable Swing GUI? I mean: a dialog or a menu pops up faster than I can notice under Swing, and SWT is just a glimps faster. But: Eclispe is an incredible slow IDE on big projects, build times, simple searches, refactorings, everything takes 10s of seconds up to minutes.

      I use in my own company CodeGuide from Omnicore.com ... that IDE is in real work 100 times faster than Eclipse ... and the fact that a menu is not up in 1/100 of a second but only in 1/50 of a second ... that I don't need. That the preference dialog looks more native in Eclipse than in CodeGuide ... I don't need either. Furthermore ... but that drives me away from your argument: the GUI of Eclispe is not that well designed, a lot of often needed functionality is difficult to access e.g.: right mouse -> search -> reference -> work space. And back to my previous note, that takes about 30 seconds on Eclispe while CodeGuide does it in 1 or 2.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    78. Re:Java eh? by angel'o'sphere · · Score: 1


      I've done this four times now; written a C equivalent of a Java program and found it at least one, often several orders of magnitude faster. I've yet once to be shown a Java program that is significantly faster than its C equivalent.



      This is a silly challange. If the two programs use the same algorithm and the same data structure, the java program will be slower by the time needed to start up the JVM and by the time needed to JIT compile the code and by the time needed to optimize (HOT SPOT) the often used code.

      After all that you have a machine code executeable in Java wich is more or less the same like the C program, except for HOT SPOT optimization.

      So they are bottom line equally fast if you run it for lets say 100 days.

      OTOH there are lots of Java programs doing something which a simnilar C program does, but the Java program is faster. Example: Apache Tomcat versus "Apache, the Web Server". The Java Tomcat is faster under load, it serves more pages.

      Your challange makes even less sense if we just make this:
      You and I make a program for a problem today. You write it in C, I in Java. We both compile and link it to an executeable. We make our performance test in 15 years from now. Your macine code executeable will then run on a 128 bit microprocessor .... probably a completely new designed FPAG or data flow or something machine ... emulating the instructions of your old program. And mine? My program will be in a *.jar file in Java Byte Code. The VM in 15 years will JIT compile and HOT SPOT optimize it to the specific hardware architecture, wich will be in use at that time.

      I would estimate my program will *then* beat yours with ease.

      This challange may sound strange, but it is not. When Apple switched to the PowerPC architecture, still a lot of the code running was written in 68k code and emulated by the OS. On Pentium processors its just the same with old 16 bit code. Often old code on a new machine is even slower than on the original machine.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    79. Re:Java eh? by angel'o'sphere · · Score: 1


      Compilers are quite capable of finding out or being told what architecture to compile for and this includes various x86 types. Sorry , but your argument is invalid.

      It is not invalid. the poster was reffering to the difference between compile time and run time.
      The compiler can not tell on what processor teh code will run, only you can tell teh compiler for what processor it should optimze, thats a difference.
      angel'o'sphere
      P.S. you could mod your parent redundant however, the exact same post was posted some weeks ago in an other "Java is Slow" discussion :D

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    80. Re:Java eh? by markbthomas · · Score: 2, Insightful

      I don't buy the idea of having to take a significant performance hit now and for the forseeable future for the sake of hypothetically being able to run my program faster in 15 years time on a hypothetical machine that doesn't exist yet.

      Besides, I have the source to my program; I can recompile it for the new architecture in 15 years' time.

    81. Re:Java eh? by angel'o'sphere · · Score: 1

      Well, it would be interesting if you could tell which Java app you are reffering to.

      Probably one of us could tell you what is wrong :D, wrong VM, wronog call parameters, or simply: wrong app?

      OTOH, in case every Java app you use is slow, I asume it has a very simple reason: Java hates you ;-)

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    82. Re:Java eh? by tolan-b · · Score: 1

      I don't know what version of eclipse you've used but but it sounds like a broken build. I had a similar problem with one GTK build in redhat 9, but haven't seen anything similar since. I never notice the background rebuilds, and i've never had to wait more than a second or two for a full project search, and that's with loads of library source included as part of the project, so a pretty sizeable codebase overall.

    83. Re:Java eh? by angel'o'sphere · · Score: 1


      I attribute most Java slowness to poor programming techniques.

      Very true!

      But in a year or so you will see the same fopr C# and otehrs.

      Java and the IDEs for Java make programming seem easy, so everybody and his mom is doing it.

      Another thing which is very easy in Java is to combine the same library but in different version into the same executeable.

      So you have an old XML parser for your config files and a new one for the XSLT transformations and a further one used by HTMLTidy to check some generated HTML ... finally you have a hugh amount of meemory wasted because every important class exists in 3 or more versions. Doing that is EASY in Java, but most programmers lack the knowledge how to do that in C++ so they dont write such programs and the good C++ coders of course avoid that issue and hence their app is faster.

      Java is a sound choice for modern computing, and you only need a "normal" but educated developer for making successfull projects.

      Crappy and slow apps are allways caused by either incompetent developers or incompetent management forcing developers to meet impossible goals or impossible deadlines.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    84. Re:Java eh? by BlackHawk-666 · · Score: 1
      I'm pretty sure the IDE in question was Forte from Sun. Now, if Sun can't get their IDE running nice and snappy on their own language, what hope is there for others?

      You may be right of course, Java might hate me ;-) I think it can smell the Windows PC scent on my fingers when I get home from work cause it always plays a Skunk Anansie track when I turn it on ;->

      --
      All those moments will be lost in time, like tears in rain.
    85. Re:Java eh? by angel'o'sphere · · Score: 1

      Well,

      and I reengineered y2k software where we had several 10k lines of machine code where no source was available.

      So, you might have your program sources still around in 15 years, sure. But are you sure the user of your program knows you, contacts you, has a C compiler for you?
      My example was hypotetical ... not to say that Java is superiour or C sucks, but to point out what the difference between C and Java bottom line is.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    86. Re:Java eh? by Anonymous Coward · · Score: 0

      Still doing your part to shill for the tools market, I see. Learn how to make an honest living, Mr. Non-Coding Salesman.

    87. Re:Java eh? by Anonymous Coward · · Score: 1, Insightful
      there are lots of Java programs doing something which a simnilar C program does, but the Java program is faster. Example: Apache Tomcat versus "Apache, the Web Server". The Java Tomcat is faster under load, it serves more pages.

      Only for workloads that are specifically chosen to play to Tomcat's strengths. Anyone can cook a benchmark, but it takes a real designer to design a webserver that's really faster for real-life workloads. You'll never be a real designer, from what I've seen.

    88. Re:Java eh? by Anonymous Coward · · Score: 0

      C: 30 seconds, Java: 8 hours. No kidding.

      Can you post the code? There's obviously something amiss here.

    89. Re:Java eh? by gtrubetskoy · · Score: 2, Insightful
      Apache Tomcat versus "Apache, the Web Server". The Java Tomcat is faster under load, it serves more pages.

      This has got to be an urban legend of some sort. I cannot see how Tomcat would ever be faster than Apache. If what you say were the case, why would people go through all the trouble of putting Tomcat behind Apache with mod_jk, etc to seprate static content serving from dynamic requests?

      I can also say that my unscientific tests of Tomcat vs Python running under mod_python showed no clear winner. The point is that Python does not proclaim to be ultra-fast, while Java does.

    90. Re:Java eh? by marcovje · · Score: 1


      Sure, if take C's worst case, and HotSpot's best case, then of course I can make HotSpot look good.

      In practice however, C/C++ code runs circles around nearly all Java code. Period

    91. Re:Java eh? by marcovje · · Score: 1


      Yes, otherwise he has to ensure there is the right version Java machine correctly configured.

      I take my changes with a P-IV optimized version that runs on anything till 486.

      Since the majority of the cycles will be brought in by the P-IV and Athlon series, there is no problem, since Athlon runs non SSE P-IV code quite decently

    92. Re:Java eh? by jovlinger · · Score: 1

      ... because photon rendering is bottlenecked by the GUI?

      How is GUI performance relevant to the problem at hand?

    93. Re:Java eh? by jovlinger · · Score: 1

      I would have thought that IEEE compliance required bit-identical results for bit-identical inputs.

    94. Re:Java eh? by Anonymous Coward · · Score: 0
      I've still yet to be shown an example of a Java program that runs faster than an equivalent C or C++ program



      $ cat main.c

      #include <stdio.h>
      #include <malloc.h>

      void main() {
      int i;
      for (i = 0; i < 123456789; i++) {
      char *x = (char *) malloc (100);
      free(x);
      }
      }

      $ date; ./main; date
      Thu Apr 15 11:10:14 CDT 2004
      Thu Apr 15 11:11:50 CDT 2004

      $ cat Main.java

      public class Main {
      public static void main(String[] arg) {
      for (int i = 0; i < 123456789; i++) {
      Object o = new Object();
      }
      }
      }

      $ date; java -classpath . Main; date
      Thu Apr 15 11:12:14 CDT 2004
      Thu Apr 15 11:12:19 CDT 2004

      $

    95. Re:Java eh? by marcovje · · Score: 1

      >One language is not generically faster than another language

      Of course it is. GC comes at a price, abstract datatypes come at a price, since they usually require runtime helpers to figure them out.

      Of course compilers can soften this a bit for built-ins, and even a bit more for datatypes based on generic programming (templates, generics), but
      the fact remains.

      >Leaving aside that you are now comparing a set of compilers to a language

      A language is as fast as the fastest compiler I can acquire and use for my problem.

  2. Bad link by tulare · · Score: 1

    or bad DNS? Either way, I can't resolve.

    --
    political_news.c: warning: comparison is always true due to limited range of data type
    1. Re:Bad link by mirko · · Score: 4, Informative

      I added "www." to the URL, it works.
      Try this...

      --
      Trolling using another account since 2005.
  3. Dude, you should try out China by alphakappa · · Score: 5, Funny

    I hear they use cycles big time there. Pretty cheap too comapared to cars.

    --
    "When the only tool you own is a hammer, every problem begins to resemble a nail." - Abraham Maslow (1908-1970)
    1. Re:Dude, you should try out China by Anonymous Coward · · Score: 0

      But they've only got a billion or so. What can you do with that?

  4. More distributed processing by isugimpy · · Score: 4, Insightful

    This is a wonderful thing to see. Distributed processing is a wonderful way to spend those extra clock cycles that most of us have, while at the same time benefitting someone else. I really hope to see more projects like this in the future.

    1. Re:More distributed processing by M1FCJ · · Score: 2, Funny

      Sorry, I don't have any. I've already donated everything I have to Seti@home. If I get some new PCs I might reconsider where to donate to but I run four PCs at home just for Seti@home. No space cycles yet. I have a rusty racing cycle if you are interested. :)

    2. Re:More distributed processing by FireFury03 · · Score: 2, Interesting

      I'd love to see some estimates on how much more electricity the average workstation uses when having all it's idle CPU time being sucked up by these distributed clients. Yes, distributed computing is a nice idea, but I don't see the benefits for the people actually running the client machines since they're not getting paid for their trouble and it's actually costing them for the juice.

    3. Re:More distributed processing by Stween · · Score: 3, Insightful

      It's voluntary.

      If you don't want to pay however much extra it might be, you don't have to participate; nobody's forcing you.

    4. Re:More distributed processing by FireFury03 · · Score: 1

      I wasn't complaining - I just said I'd like to see some power consumption estimates. Most people don't realise that the power consumption of the CPU changes depending on the amount of work it's doing. Most modern operating systems do power saving in their idle loops - when idle the OS tells the CPU to essentially power off for short periods of time, and in the case of many laptop CPUs it can also reduce the clock speed. But even if the OS doesn't do any power saving when it's idle, the CPU will use less power than if a process is hammering the FPU with floating point math (which is what ray tracing and probably the likes of SETI will do).

    5. Re:More distributed processing by essreenim · · Score: 1

      for:

      Ray-tracing is far cooler!!!

    6. Re:More distributed processing by Anonymous Coward · · Score: 1, Insightful

      It would be great if everyone on the net would allow their machines to be used to do important things, such as curing cancer. However, the average person who writes such code is also the same person who wouldn't let you touch their keyboard yet alone play on their machine. Then that same type of person wants everyone else to run code (compiled code at that) on their home machines. I'd do it if I were allowed to get the source, then compile myself. Otherwise, I could write code to do something important, release it asking everyone to run it in the background. I could then be the most distributed spammer on the face of the earth (Muhaha Muhaha).

    7. Re:More distributed processing by kpearson · · Score: 1

      Why wait for the future when you can see more projects like this now? Internet-based Distributed Computing Projects

    8. Re:More distributed processing by Fjord · · Score: 1

      I, personally, see the benefit in projects like Folding@Home, where we haved increased our understanding of proteins in demonstrable ways, and could lead to antiviral agents analagous to pencillin in the bacteria world. I would like to know those numbers as well, tho. It would be nice to write it off on a taxes.

      --
      -no broken link
  5. Real URL to image by FrenZon · · Score: 3, Informative

    Emailed this to the editor, but something must've gone wrong.

    The URL to the photo soup image is missing the 'www'. The image can be seen here (you may want to do a 'Save Target As', as the mime-type seems to be a bit off).

    1. Re:Real URL to image by Anonymous Coward · · Score: 0


      Doesn't work without "www"? Wow, that takes me back to 1998.

    2. Re:Real URL to image by jridley · · Score: 2, Insightful

      This is because his web server is claiming that the MIME type of the GIF is "text/plain"
      I bet if it was .gif instead of .GIF it wouldn't to that. But his server should work either way.

      Time to edit httpd.conf

    3. Re:Real URL to image by bwy · · Score: 1

      His Tomcat server doesn't have a mime type configured for type "GIF". He probably has "gif" but for some reason not "GIF". IE doesn't care because it guesses the Mime type, but Gecko based browsers won't display the image because in this case they work more strictly off of the Mime type.

    4. Re:Real URL to image by Zzootnik · · Score: 1

      Yeah- I noticed that when I switched to the tab I had it loading in and got a big page full o text.

      Pretty simple though- I just hit "Save Page As...", popped it to my desktop with the right extension and there it was. Pretty cool looking pic. (Not everything needs to happen IN the browser, y'know...) And thanks again Mozilla!

      --
      Sig currently under construction. Mind the gap....
    5. Re:Real URL to image by rkeene517 · · Score: 1

      Sorry about that. It works fine for me from my office.

      --
      Inside every complex program is a simple solution trying to get out.
    6. Re:Real URL to image by HTH+NE1 · · Score: 2, Informative
      Microsoft Internet Explorer, right?

      IE ignores the MIME type provided it by the server, in violation of RFC 1945 and RFC 2616 ("Hypertext Transfer Protocol -- HTTP/1.0" and "...-- HTTP/1.1") sections 7.2.1 (reprinted below from the latter), and instead sniffs the content to determine how to render it. Anything served as "text/plain" is treated with suspicion and reinterpreted by IE in violation of this section.
      7.2.1 Type

      When an entity-body is included with a message, the data type of that body is determined via the header fields Content-Type and Content-Encoding. These define a two-layer, ordered encoding model:

      entity-body := Content-Encoding( Content-Type( data ) )

      Content-Type specifies the media type of the underlying data. Content-Encoding may be used to indicate any additional content codings applied to the data, usually for the purpose of data compression, that are a property of the requested resource. There is no default encoding.

      Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".
      Microsoft breaks this in that they don't understand what "if and only if" means (i.e. the client MUST NOT guess media type by inspection when any type IS provided by the server).

      While this makes their browser work with misconfigured servers that fail to set types correctly, the habit of testing with that and only that browser effectively hides the problem from authors and breaks pages for every browser that follows the RFC.

      As this is seen as a benefit for IE over other browsers, Microsoft is uninterested in fixing it. Compare Netscape's unclosed quoted attribute bug which broke other browsers and which Netscape did fix, but then made previously working pages require fixing.

      Please test your pages with standards-compliant browsers, including HTTP standards, and fix the problem with the server by assigning the appropriate file extension mapping of ".GIF" to "image/gif" on your server. (And every other case variation while you're at it.) Or rename the file to have a .gif (lowercase) extension, which likely will work.
      --
      Oh, say does that Star-Spangled Banner entwine / The myrtle of Venus with Bacchus's vine?
    7. Re:Real URL to image by Anonymous Coward · · Score: 0

      Screw the cycles, I can do a better version of that image in Photoshop in about 5 minutes. Even the Gimp would work for that...sheesh.

  6. java 3000 times slower by Anonymous Coward · · Score: 0, Funny

    yes, computers are now 3000 times faster, but with java 3000 times slower than C, there won't be much difference...

    1. Re:java 3000 times slower by kirinyaga · · Score: 2, Insightful

      Not really. There is an overhead in java, indeed, but it's caused mainly by objects management. To perform pure calculation, about any language will perform the same. The limit here is the CPU.
      Try to factor a big number in C, C++, java or fortran, it will take exactly the same time. The few seconds difference you'll get after a day of calculation are the language overhead that occurs between calculation loops, totally irrelevant when what you do is _only_ those calculation loops (a situation that occurs rarely in traditional development, granted).
      Of course, the guy wants his program to run on several kinds of platform but probably cannot afford to develop and test on a lot of OS & machines, so Java seems to be the proper solution.

      --
      Kirinyaga
    2. Re:java 3000 times slower by Anonymous Coward · · Score: 0

      Your complete, total and utter ignorance is showing.

      At least understand what you're talking about before trying to be funny... I assume that was your intention? (You failed)

      Look here to see just how wrong you are:
      http://www.osnews.com/story.php?news_id=5602

    3. Re:java 3000 times slower by Emil+Brink · · Score: 1

      That statements is so full of hidden assumptions that you could probably fill, um, something really big with them. It is kinda "true in theory", but in practice... Whoa. What about non-compiled languages? Or langauges that lack support for native data types? Or the combination thereof? Try to factor a big number in bash. Or XSLT. They are langauges, and I'm pretty sure at least bash is Turing complete, but the performance is not magically on par with e.g. C. I'm sure it *can* be, in theory, but... In practice it just isn't.

      --
      main(O){10<putchar(4^--O?77-(15&5128 >>4*O):10)&&main(2+O);}
    4. Re:java 3000 times slower by Anonymous Coward · · Score: 0

      That article shows absolutely nothing. It was written by someone who is not knowledgable about the languages he was using, nor was he knowledgeable about benchmarking in general.

  7. old hardware by cybermint · · Score: 1, Funny

    Brand new article and it's already slashdotted to hell. He must be running the webserver on one of those old crappy sparc machines he talks about.

    1. Re:old hardware by jabbadabbadoo · · Score: 1

      And now it runs Java number crunching in the background.

  8. Java? by Kent+Simon · · Score: 4, Insightful

    nothing against Java it has its place, but for something this CPU intensive, it seems like you'd be wasting CPU cycles. This sounds like a job for C.

    --
    Kent Simon Multitheft Auto
    1. Re:Java? by bishiraver · · Score: 2, Informative

      Or FORTRAN. FORTRAN is more traditionally used in scientific computing anyways.

    2. Re:Java? by hayds · · Score: 5, Insightful

      Java can actually be quite fast and efficient for number crunching or scientific applications because of the JIT compilers and automatic optimisation. Its only painfully slow when you need a GUI. It also has a great class library so he should be able to do things like the visualisation and the networking for the clients to send the data home relatively easily, whereas it would take a lot longer to write and debug in C.

      Also with Java, he can just offer the JAR file on his site or whatever and people can d/l it and run it. I guess this isnt really important if he's aiming at geeks, but if he's trying to get others to participate, it is handy that people wont need to worry about compiling it themselves or picking the right version (like at the seti@home site).

    3. Re:Java? by Anonymous Coward · · Score: 5, Informative

      Not really that slow, depends on what you're doing. At work we're using a CPU intensive Java based "optimizer" that runs a hybrid Genetic Algorithm. We also have a very similar version that was coded in C++. Chances are that the C++ coders sorta sucked, but the end result has been pretty much the same. The only difference was that our Java application actually DOES run on many platforms, including Windows, SuSE, and MacOS X, without a problem. And I can't say it enough times, it's just as fast as the C++ version that only runs on Windows .

    4. Re:Java? by fucksl4shd0t · · Score: 1

      Or FORTRAN. FORTRAN is more traditionally used in scientific computing anyways.

      That's because the only reason scientists aren't the biggest Luddites in the world is because there are still musicians in the world. *sigh*

      --
      Like what I said? You might like my music
    5. Re:Java? by Xeth · · Score: 1

      Regardless of efficiency, Java is a good way to make a program work across a variety of platforms, which is especially helpful in this situation, when you're asking a bunch of people with heterogeneous machines to run your program for you.

      --
      If your theory is different from practice, then your theory is wrong.
    6. Re:Java? by bishiraver · · Score: 1

      If it's not broken, don't fix it? FORTRAN is an excellent language in which to calculate complex scientific models.

    7. Re:Java? by eric76 · · Score: 3, Insightful

      I think the primary reason is that there are enormous numbers of numerical routines in Fortran that are extremely well debugged and validated.

      Change to other languages and those routines must be rewritten, redebugged, and revalidated.

    8. Re:Java? by steve_l · · Score: 1

      One specific optimisation is that on a PIII core and Java1.4.1 or later, the JIT compiler generates SSE instruction codes for FP math, rather than using the x86 part. So the floating point performance is better than what you'd get if you just compiled a single binary for one x86 platform and let people run it.

      So doing CPU intensive algorithms in Java does make sense. GUIs, that is a different matter, but things are improving there too:)

    9. Re:Java? by cheekyboy · · Score: 1

      I assume you are not a programmer right?

      JAVA by its nature, should be fastest at GUI's, (unless their gui libs are written in basic).

      eg. open window, draw 4 buttons, draw 8 checkboxes, draw 2 text boxes, draw listbox with 5 items.

      Now to set that up in C/C++ is trivial in a win resource and win32 or mfc. In Java, it should likewise be trivial for the libraries even with translation of lots of crap to native mode. We are in 2ghz+ cpus here, not P233mhz's PCs. If you window takes >100ms to draw, thats 300million instructions (very roughly) and if you cant do it in that, then WTF are you a programmer?

      What does java do ? PlotPixel() each button and option via a x/y framebuffer?

      RE: right version to download, a smart person would setupup a decent php download script to auto detect the OS via the browsers agent field. (yes you can place direct links or are you sure buttons)

      So.. we have powerfull computers, smart tool kits and languages that can automate just about anything, but people are getting very very slack and unimaginative.

      --
      Liberty freedom are no1, not dicks in suits.
    10. Re:Java? by groomed · · Score: 1

      No, it's actually the right tool for the job. The only problem is that he'll be wasting an awful lots of people's memory.

    11. Re:Java? by hayds · · Score: 1

      I assume youve never actually used a Java app right? And I assume you are also not a programmer? (And yes I am actually)

      You can go on about 2ghz+ CPUs and 100ms window draws all you like, but the simple fact is that complex GUIs in Java are slow. Ever tried Sun's own Java IDE? I tried it a few years ago when it was called Forte, I think its called something else now. Anyway, it used up 120Mb of RAM, took about 3 minutes to start and was pretty painful to use. Thats an extreme example (and I admit quite an outdated one) because it has a very complex GUI but it demonstrates my point; Java GUIs are slow.

      And you are right, java guis have been getting faster but I think that has as much to do with a much improved JVM in recent times as it has to do with increased CPU performance. Either way, they are still nowhere near as responsive as a native GUI. Personally for GUI apps, I prefer cross platform C++ toolkits (QT is very nice) rather than Java because you get native performance and native widgets.

      But all that aside, the point of my original post was that this guy isnt writing a GUI app, so Java suits well because it gets good mathematical optimisation through the JIT, its easier to write than C and its fully cross platform.

    12. Re:Java? by Specialist2k · · Score: 1

      Shouldn't Just-In-Time compilation speed up the process to an acceptable level? Sure, the memory footprint will still be larger than for an equivalent C or assembler program, but speed shouldn't be an issue if you are using a current JRE.

    13. Re:Java? by Agent+Orange · · Score: 1

      well, partly, but also partly just because scientific/engineering calculations are inherently more efficient in fortran. It's what the language was designed for.

      Another reason is that a lot of "old-timer" scientists use it (see above), so the tradition continues. One of the things that keeps it going is the "Numerical recipes in fortran" books, which have heaps of canned numerical algorithms. This books is now also available in C.

      And finally, there's just a lot of scientific applications which are legcay code and which were designed to integrate with fortran. In the astronomy world, examples are figaro and iraf data reduction pacakages.

      Use the tool that's best for the job, and in numerical/science applications, that tool is fortran. google provides me with this link.

    14. Re:Java? by Anonymous Coward · · Score: 0

      fact 1.
      I hate Java. I am a C++ developer.

      Fact 2.
      Java has its place, just not near my place

      Fact 3.
      Java is in my oppinion worse than a virus, at least you can get rid of a virus

      Fact 4.
      I would rather install RealOne than Java on my machine

      Fact 5.
      Compiling from Java to Java Byte Code to Native Code is either as fast as C/C++ or in some cases faster since the abstract syntax tree is represented in two different models which can each be optimized instead of a single tree with a single level of optimization.

      Fact 6.
      Integer and Floating point math run for scientific applications often runs faster when compiled form Java Byte Code than it does from C/C++

      Fact 7.
      On machines able to handle more than a single calculation at a time (Hyperthreading for example) a JIT can be tailored to compile the code to a native version capable of executing non-linear tasks across processing units.

      Fact 8.
      A special JIT can be developed to offload integer/floating point calculations to the graphic card GPU which would improve performance of a C/C++ program by maybe as much as hundred fold due to the raw number crunching ability of the GPU.

      Fact 9.
      Some of the options above are not yet available, but since the JVM JIT recompiles compiled byte code, it is possible to release code compiled now which later can run faster by using new technologies. CPU native code does not have that advantage.

      Fact 10.
      Thank god I don't write scientific apps for a living, or else I might use Java which would incline me to change careers.

      Fact 11.
      I've written an EDA CAD with board layout and push/shove autorouting in Java. Swing/AWT is a good enough reason to never program in Java again.

    15. Re:Java? by goatan · · Score: 1
      That's because the only reason scientists aren't the biggest Luddites in the world is because there are still musicians in the world. *sigh*

      And bill gates

      --
      Saying Apple is better than MS is like saying Botulism is better than rabies.

    16. Re:Java? by ninewands · · Score: 1
      Quoth the poster:
      That's because the only reason scientists aren't the biggest Luddites in the world is because there are still musicians in the world. *sigh*

      I disagree! Most of the musicians I know EMBRACE advances in technology! I find scientists and engineering professors MUCH more conservative when it comes to change.
    17. Re:Java? by fucksl4shd0t · · Score: 1

      It's pretty split among the musicians and scientists I know. They're all conservative in weird ways. In any case, my opinion based on the aggregate that I see in the news, anyway, is that musicians are at the bottom of the list and scientists are next. Engineers are the earliest adopters of anything they engineer, and nothing that is competitive to them, seems like. ;) Hell, even among computer programmers I know there's some interesting contradictions. The guy down the street loves trees and hates ecologically-unfriendly technology but refuses to drive anything but '70s-era suburbans because he's afraid of getting crushed in a car accident.

      I might put record label executives below musicians, but to do that I'd have to admit they were people, and I'm not going to do that. ;)

      --
      Like what I said? You might like my music
  9. Hi-quality pr0n by Compact+Dick · · Score: 3, Funny
    Now ... I am doing it again only much better, with a smaller aperature [sic], in stereo, with 3 cameras ...
    The world needs more dedicated releasers like you.
    1. Re:Hi-quality pr0n by Anonymous Coward · · Score: 0

      smaller aperature [sic]

      God damned... I was going to flame you to shit for putting [sic] after that, but I just checked and sweet screaming Jebus on a stick you're right!

  10. No by Anonymous Coward · · Score: 0

    It's a Java Trap.

  11. Nah by AstrumPreliator · · Score: 4, Funny

    I don't feel like donating a few trillion cycles to produce an image that says "The page cannot be displayed". Possibly if you made it say, "The photons cannot be displayed", I would think about it.

    =P

    1. Re:Nah by Nuclear_Loser · · Score: 2, Funny

      Or better - "Your eyes cannot possibly comprehend the intensity of this image. The photons will not be shown for the sake of your sanity and/or ability to see."

      --


      You've got 8% of my love - 8% of my love - 8/100's of the time you're the only girl I'm dreaming of.
  12. Mirrored, just in case by cybermint · · Score: 2, Redundant

    It's just a graphic, so I doubt it will go down, but here is a mirror just in case.

    http://www.antigamer.com/DRUN.GIF

    1. Re:Mirrored, just in case by Anonymous Coward · · Score: 1, Insightful

      Thanks for the mirror -- the site is down. I have to admit, the image is not what I'd expected.

      The story submitter talked about simulating a number of photons, which made me assume this was a simulation of quantum mechanics or perhaps of quantum fields.

      But the image looks like it is somebody's ray tracing project. This is geometrical optics, and not quantum mechanics. The term "photon" should not be used in this context, as it is misleading.

      Ray tracing is a discretization strategy used to approximate a (usually continuous) distribution. In this case a Monte Carlo approach would evidently be used...

      Whereas the term 'photons' implies field quantization. This is a much more complicated situation than the rays used in geometrical optics.

    2. Re:Mirrored, just in case by Anonymous Coward · · Score: 0

      p.s. I don't mean to criticize the project. I was just surprised and a bit crabby that I was fooled by the description. I'll probably donate some spare cycles in the near future. I have never done any raytracing, but I have played around with OpenGL. 3d rendering is interesting stuff.

  13. Mirror by Anonymous Coward · · Score: 1, Informative

    Don't sweat it, I got a copy of the linked image.

    The original was silly, too -- it sent back the image as Content-Type: text/plain. I don't understand it at all, but since the server is toast now, it doesn't really matter either way. :-)

  14. Best time is Winter by DigiShaman · · Score: 4, Funny

    The best time for these project is in the Winter time. Because, that's when I have my heater on. And if my CPU is running 100%, then the heat from it will help heat up my appartment rather then the heater needing to kick on.

    I mean, I don't mean to belittle this project. But for all grid computing projects, there is a better time and place for this in my opinion.

    --
    Life is not for the lazy.
    1. Re:Best time is Winter by Tuqui · · Score: 1

      The new heaters model will be SETI or Folding@Home compliant. Cool ... I meant Hot.

    2. Re:Best time is Winter by Exiler · · Score: 2, Insightful

      Good thing the other half of the world is in winter then, isn't it?

      --
      Banaaaana!
    3. Re:Best time is Winter by ObviousGuy · · Score: 1, Funny

      The other half of the world is in night time.

      --
      I have been pwned because my /. password was too easy to guess.
    4. Re:Best time is Winter by DigiShaman · · Score: 1

      I'm willing to bet the majority of the slashdot readers are in the Northern Himisphere...which is in Spring going on to Summer. But for those in Aussi land, It's fall going on to Winter.

      --
      Life is not for the lazy.
    5. Re:Best time is Winter by Anonymous Coward · · Score: 1, Funny

      You mean East/West. He means North/South. Need a chart?

    6. Re:Best time is Winter by Walkiry · · Score: 1

      Actually the other half of the world is in Autumn. Didn't you learn the four seasons in school?

      --
      ---- Take the Space Quiz!
    7. Re:Best time is Winter by Anonymous Coward · · Score: 0

      well if you are going to be pedantic and condescending (about a joke no less), then didn't you learn in school that not all countries/environments have the typical "four seasons"?

    8. Re:Best time is Winter by eclectro · · Score: 1

      Good thing the other half of the world is in winter then, isn't it?
      The other half of the world is in night time

      So, that means that one quarter of the world is in the dark and cold.

      --
      Take the cheese to sickbay, the doctor should see it as soon as possible - B'Elanna Torres, "Learning Curve"
    9. Re:Best time is Winter by Anonymous Coward · · Score: 0

      >(about a joke no less) What did you think my reply was? Also, since we'Re pedantic and condescending, didn't you know the vast majority of computing power is in countries within the "four seasons" cycles, so your so-called point is moot.

      Care to try again, or will you realize you're not the only one that can crack jokes?

    10. Re:Best time is Winter by ConceptJunkie · · Score: 1

      I live in the Northern Hemisphere. I have two him-i-spheres.

      --
      You are in a maze of twisty little passages, all alike.
    11. Re:Best time is Winter by dfj225 · · Score: 1

      I think you need to add Insensitive Clod to that.

      --
      SIGFAULT
  15. Broken link, java jab by Dominic_Mazzoni · · Score: 4, Informative

    The link to the image should be http://www.cpjava.net/raytraces/DRUN.GIF (The www is necessary and was left out of the link in the article.)

    People are already cracking jokes about how the fact that it's in Java will mean that it will run a lot slower than it could. While I love to pick on Java as much as the next person, I am curious how much it actually makes a difference for raytracing - does anyone know? My experience with numerically-intensive algorithms is that Java is 2-4x slower than C. You can get it within 2x of the speed of C if you ignore object-oriented programming and you're really good at Java optimization, but that's it. And it will run much slower on some architecetures because Java guarantees certain floating-point operation semantics at the expense of speed.

    If I were writing a new numerically-intensive program from scratch that I wanted to use for a cross-platform distributed computing project, I'd probably do it in Numerical Python (NumPy) - my experience has been that it can be within a factor of 2-3 of the speed of C, but it's much more concise, requiring half as many lines of code as Java or C to do the same thing. And these days Python is just as cross-platform as Java - it definitely runs great on Mac, Windows, and Unix.

    1. Re:Broken link, java jab by evanbd · · Score: 5, Informative
      Not so slow as that... I have no idea about raytracing, but I've done several compute-intensive applications with Java. Both of them, the Java code has run at most 20-30% slower than the C. The two that I have worked with recently are a program that plays Amazons (a modern board game; fairly nifty) and recently one that does stuff with MD5 (searching for partial collisions). Now, I consider myself competent at Java optimization, but by no means an expert. So, a couple minor pieces of advice for anyone who wants to make their java programs a bit faster, and doesn't really know how:

      1. Learn to use java -Xprof. This is a rudimentary profiler, but even the most basic data is useful. Concentrate on the parts that get the most use.

      2. If -Xprof says the garbage collector is taking more than about 1-2% of the cpu, it's a problem. If it's at 10%, it's costing you well more than 10% speed -- lots of reasons, like cache misses, thread switching, and the allocations in the first place.

      3. Don't delete objects in the main loop. Use factory methods and the like if you have to. This is how you decrease GC times.

      4. Some of the standard API pieces are very slow. I've had particular trouble with anything related to the Collections framework, and Strings are even worse. Avoid these.

      Now, all this takes work, but it's not particularly harder or easier than doing good optimization of C Code.

    2. Re:Broken link, java jab by fucksl4shd0t · · Score: 1

      Actually, I recently saw a series of benchmarks that showed Java right up there with C++ for floating point ops and integer ops, using Sun's VM. I don't recall where I saw it, but I was googling for a java/python comparison, actually. Java appears slow on the GUI because GUI stuff doesn't byte compile quite as well as the other stuff. For pure computational stuff the JVM can assemble the bytecode almost 1:1 into native code, but for GUI stuff it has a *lot* more work to do to get it.

      --
      Like what I said? You might like my music
    3. Re:Broken link, java jab by illumen · · Score: 1

      You can also compile your numeric code into blitz(optimized C++ templated libraries) which are pretty speedie(2-4* faster than numeric).

      http://www.scipy.org/site_content/weave

      Then get a good vectorizing compiler like vectorc. Which can often produce much faster C/C++ output compared to gcc.

      Then you have far better speed than java, more readable code, in less time. Yah! multiple languages win again :)

      Of course for a distributed FP program, maybe java is better for the results, as I heard earlier the fp ops are equivalent on different architectures. Whereas even on x86 different machines give you different fp results.

      Now if only I/someone could get around to finishing that runtime assembler optimizer for numeric...

      Have fun!

    4. Re:Broken link, java jab by Anonymous Coward · · Score: 0

      Actually, since ray-triangle intersection (at the very heart of all raytracers) is something that can be both vectorized and software pipelined, C compilers with vectorization support (e.g. Intel C 8.0) can emit code around 3 times faster (for SSE2 CPUs) than straight C.

    5. Re:Broken link, java jab by Anonymous Coward · · Score: 4, Informative

      ...and don't forget "-server". The Sun 1.4.2VM with -server now generates SSE code, giving a nice boost to FP apps.

    6. Re:Broken link, java jab by ajs · · Score: 3, Insightful

      Yeah, tools like this are excellent. In the astro community, they use a tool called IDL (interactive data language, I think?) which is similar. High level constructs, with lots of big primatives to get you very fast computation.

      Perl has an excellent tool called PDL that does roughly the same thing, and is used by the Perl/Gimp interface, yeilding some wonderful possibilities.

      That said, Java was the right choice for this. Java may have poor systems integration and a host of issues that arise from that (i.e. Java's platform agnosticism, which actually turns into a sort of single-platform dependence on itself with little or no integration with its actual platform), but when it comes to handing thousands of people a program that is going to run mathematical calculations EXACTLY THE SAME WAY on every machine, Java has Python, Perl, Ruby, C# and a host of other high level languages beat because it allows you to enforce very specific constraints on how the math will be done. All of the others just provide you with varying degrees of abstraction on top of your native execution models.

      Once Parrot is done, I suspect that more languages, ported to run on top of Parrot, will also offer these constraints as optional features, but time will tell.

    7. Re:Broken link, java jab by SuperDope · · Score: 1

      I don't have JAVA on my pewter you insensitive clod!

      --
      - "hehehe...You said boobies..."
    8. Re:Broken link, java jab by Henry+Stern · · Score: 1

      evanbd:

      I did a parallel implementation of an Amazons solver last summer. Drop me an e-mail if you want to chit chat about Amazons.

    9. Re:Broken link, java jab by Anonymous Coward · · Score: 0

      Some of the standard API pieces are very slow.

      All of the standard API pieces are very slow. Java is big bag of shit... deal.

    10. Re:Broken link, java jab by Anonymous Coward · · Score: 0

      Obviously spoken by an experienced Java programmer?

    11. Re:Broken link, java jab by inertia187 · · Score: 1

      ...or a stock holder.

      --
      A programmer is a machine for converting coffee into code.
    12. Re:Broken link, java jab by packman · · Score: 1

      Then you have far better speed than java, more readable code, in less time. Yah! multiple languages win again :)

      You have clearly never 1) seen java code 2) written java code, since java is in general much more readable than C(++) code - even as pure C(++) programmer without any Java knowledge, and a lot faster to write if you know Java as well as you know C(++). I write both for living - and both have their purposes and applications. It's simple - when writing an application - you should use the best tool for the job, and in a lot of cases, Java is that tool - but isn't used because of practical limitations (small JVM userbase most of the time) or the general believe that Java is slow.

      I had this problem at work some time ago. The server was eating memory and could not accept more than 5 connections or it would eat 1gig+ of memory. It was simple, the server was written in Java, so Java was the problem. After 6 months someone found an *oops* in a .so that the server used through a JNI interface. Fixing that *oops* allowed the server to accept more than 1000 connections at the same time, a _lot_ faster than before - with no memory problems... I never believed it was Java's problem there - but I was one of the few.

      Bad coding == bad results - in C, Java, Python, Perl - whatever.

    13. Re:Broken link, java jab by batura · · Score: 1

      Some of the standard API pieces are very slow. I've had particular trouble with anything related to the Collections framework, and Strings are even worse. Avoid these.

      That makes a lot of sense if you iterate through strings or vectors a lot, since their operations are O(n). If you are interested in speeding this up, let me recomend the TreeSet (or Map, I can't remember). Its a tree, so most operations are O(logn) and much quicker. Also, be smart; I've found myself doing some really supid things from time to time with O(n) operations in loops that end up being O(n^2)

    14. Re:Broken link, java jab by Frizzle+Fry · · Score: 1
      You can get it within 2x of the speed of C if you ignore object-oriented programming and you're really good at Java optimization, but that's it.

      If I'm going to have to "ignore object-oriented programming", then I don't think I'd bother programming in java at all.
      --
      I'd rather be lucky than good.
    15. Re:Broken link, java jab by Anonymous Coward · · Score: 0
      You have clearly never 1) seen java code 2) written java code, since java is in general much more readable than C(++) code
      Before you go lobbing insults, you might want to make sure you actually know what you are talking about here. Hint: you don't. The poster never said, nor implied, that C++ was more readable than Java. He is talking about writing in Python with Numeric. You can use Weave to translate the Numeric code into Blitz++, which is a fast C++ library. Then you can use a good C++ compiler like vectorc to turn this into fast machine code. You get the readability and ease of development from Python, and execution speed from C++ libraries and optimizing compilers.
    16. Re:Broken link, java jab by Trinition · · Score: 1

      Regarding #3, that is not generally true. Check out Brian Goetz's article, where he points out:

      Object pooling is a straightforward concept -- maintain a pool of frequently used objects and grab one from the pool instead of creating a new one whenever needed. The theory is that pooling spreads out the allocation costs over many more uses. When the object creation cost is high, such as with database connections or threads, or the pooled object represents a limited and costly resource, such as with database connections, this makes sense. However, the number of situations where these conditions apply is fairly small.

      In addition, object pooling has some serious downsides. Because the object pool is generally shared across all threads, allocation from the object pool can be a synchronization bottleneck. Pooling also forces you to manage deallocation explicitly, which reintroduces the risks of dangling pointers. Also, the pool size must be properly tuned to get the desired performance result. If it is too small, it will not prevent allocation; and if it is too large, resources that could get reclaimed will instead sit idle in the pool. By tying up memory that could be reclaimed, the use of object pools places additional pressure on the garbage collector. Writing an effective pool implementation is not simple.

      In his "Performance Myths Exposed" talk at JavaOne 2003 (see Resources), Dr. Cliff Click offered concrete benchmarking data showing that object pooling is a performance loss for all but the most heavyweight objects on modern JVMs. Add in the serialization of allocation and the dangling-pointer risks, and it's clear that pooling should be avoided in all but the most extreme cases.

    17. Re:Broken link, java jab by illumen · · Score: 1

      The more readable code comes from python. Not C++. Cheers.

    18. Re:Broken link, java jab by Pseudonym · · Score: 1
      While I love to pick on Java as much as the next person, I am curious how much it actually makes a difference for raytracing - does anyone know?

      On non-trivial scenes, the biggest hit in raytracing is cache misses. Because raytracers "probe" the geometry database, the accesses are incoherent compared with, say, a scanline renderer.

      On raytracers which support complex curved surfaces (e.g. NURBS, subdivision surfaces) but don't tesselate them, the second biggest hit is intersection testing. People who notice these sorts of things have found 10x speedups by tesselating, and according to Pixar, even a modest 30Mb tesselated grid cache using a simple LRU replacement policy can result in 99%+ cache hit rates even on fairly complex (2Gb+ gzipped geometry) scenes.

      Chances are that this scene isn't very complex from a geometry database point of view. Using peoples' spare CPU cycles is one thing. Using all of their available memory is quite something else! Given that, I'd say they're probably on par, and the estimated ~20% slowdown (assuming a good JVM) is probably accurate.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    19. Re:Broken link, java jab by evanbd · · Score: 1

      I find this result somewhat odd, because it is contrary to what I have benchamrked on my applications. My case was a heavy compute load, with a substantial number of objects created and then thrown away (basically one per very short inner loop iteration, iirc). Going to a very lightweight factory method is what allowed me to get to the point where the garbage collector did not run in my main loop at all (GC times I suppose the end result is that, like a large number of optimizations, you have to try it and see. In my case it worked, though my case is probably very different from the business logic applications I'm going to assume he used.

  16. Java huh? by Kris_J · · Score: 0, Troll

    Give me a client I can run on my (Series 60) mobile phone, just to say that I have, and I'll think about running your apps. Meanwhile, for my PCs I prefer D.Net because of its seriously optimised core -- if I'm going to donate CPU cycles I want to know they're not being wasted by computing overhead. (Usefulness of the project itself aside.)

    1. Re:Java huh? by Vellmont · · Score: 1


      if I'm going to donate CPU cycles I want to know they're not being wasted by computing overhead.


      And save them to be wasted on a pointless crypto problem that's well understood, and will take 10 years of waiting for computers to get faster to have any chance of solving.

      --
      AccountKiller
    2. Re:Java huh? by Anonymous Coward · · Score: 0

      Give me a client I can run on my (Series 60) mobile phone, just to say that I have, and I'll think about running your apps.

      And how many GHz does your phone run at? Why don't you just forget about this whole thing, it clearly doesn't interest you. Move on to the next article, please.

    3. Re:Java huh? by Lehk228 · · Score: 1

      I have a 900 Mhz phone and a 1.2 Ghz phone :P

      --
      Snowden and Manning are heroes.
    4. Re:Java huh? by Halfbaked+Plan · · Score: 1

      Whoah! You have your phone powered with a big lead acid battery?

      --
      resigned
    5. Re:Java huh? by Kris_J · · Score: 1

      You're allowed to read the bits in the brackets, they're not secret.

    6. Re:Java huh? by Kris_J · · Score: 1

      Well, as it happens, it's an N-Gage but I don't play any of the MMC games on it, so it has battery life to burn. And I could run the program while the phone is plugged-in overnight.

    7. Re:Java huh? by Kris_J · · Score: 1

      104Mhz ARM processor 12-bit CPU. Apparently.

  17. Is is really useful? by School_HK · · Score: 1

    Although it sounds like a good idea, JAVA is not the ideal tool to build the app for that purpose. As other guys said, java is abs('slow'). C is the best choice (except if you code in machine code). I know that java should be the most portable language, but the awful speed is a heavy downside. Anyway I think if you want to make a good film, you should find Pixar, Dreamworks or Disney -- because they have a render farm.
    By the way, are you requiring openGL or something like that to speed up the raytrace?

    1. Re:Is is really useful? by Anonymous Coward · · Score: 0

      Are u kidding about the comment about making a film? I hope so. Also, I assume that the entire raytracer is handwritten. Therefore, openGL would have nothing to do with it.

    2. Re:Is is really useful? by Anonymous Coward · · Score: 0

      Java isn't really slow anymore. That's a notion from the 90's when it was entirely interpreted. Try a recent VM with optimizations on and you'll get within 10% of C. Yes, ASM will beat the pants off it, but do you really want to code a ray tracer in ASM?

    3. Re:Is is really useful? by School_HK · · Score: 1

      Not really. For a computer with even 256MB ram, it is impossible to run 3 java apps(because there is no ram left). If no rams left, how would they be run fast?

  18. Photons by richie2000 · · Score: 5, Interesting
    Thought experiment:
    Go outside (No, it won't kill you) and look up at a bright star. Now imagine that star is in the center of a sphere and your eye is on the surface of the sphere. The aperture of your eye captures enough photons to image the star constantly. Now imagine that same amount of photons reaching all points of the sphere's surface. That's a serious bunch of photons. And the star outputs them constantly, for billions of years.

    Any biology majors here care to tell me how many photons the eye needs to 'see' a reasonably bright star? With that information, you can calculate the rest (left as an exercise for the reader).

    --
    Money for nothing, pix for free
    1. Re:Photons by ldspartan · · Score: 1

      According to one of my Psych professors, under ideal conditions the human eye can detect a single photon.

      --
      lds

    2. Re:Photons by Anonymous Coward · · Score: 0

      I suspect you are on dope, but I believe around 10 photons of the right wavelength can create a visual sensation.

    3. Re:Photons by Kelerain · · Score: 5, Funny

      According to one of my Psych professors, under ideal conditions the human eye can detect a single photon.

      For example, when looking at a photon detector.

    4. Re:Photons by Bandwidth_ · · Score: 5, Interesting

      >Any biology majors here care to tell me how many
      >photons the eye needs to 'see' a reasonably >bright star? With that information, you can
      >calculate the rest (left as an exercise for the
      >reader).

      The rods in human eyes are incredibly efficient photoreceptors. They can reportedly be triggered by individual photons under optimal conditions. This was proven by experiment in the mid 1950s sometime in a pitch black room after 30 minutes of adaptation. A controlled light source was placed at an angle of 20 degrees or so away from the eye plane and tests were done such that the absolute minimum threshold of light intensity was found. Calculations based on angle, spread, etc were made and the area the light source would hit in the eye. It was found that, as stated above, rods could reliably detect single photons.

      It's an evolutionary limit of sorts. I may be off on the procedure as I'm recalling it from an odd psychophysics book I read back at uni but I'm fairly sure of the single photon thing.

    5. Re:Photons by Yarn · · Score: 3, Interesting

      I'm a physicist, but IIRC a rod (monochrome sensor) absorbs a photon 50% of the time, and from that absorbed photon outputs a signal about 50% of the time. Hence, about 4 photons to have a high probability of detection.

      The colour sensors (cones) are less sensitive. Whilst googling for the sensitivity of these I found a page detailing the sensitivity of the eye It needs about 500 to 900 photons/sec to actually register. However, I've already written about rods so I'm not going to delete that!

      --
      -Yarn - Rio Karma: Excellent
    6. Re:Photons by nacturation · · Score: 1

      So let's take this answer and multiply it by 10 just to be safe... 100 photons... and say that the star is approximately 1,000,000 light years away to be that dim (probably quite conservative). For sake of argument, let's assume that your eye occupies 1 square centimeter.

      So 1,000,000 light years is 9.46E23 centimeters (thanks Google!), which has a surface area of 1.12E24 square centimeters. And if 100 photons strike each square centimeter, this is then 1.12E26 photons/square centimeter.

      In other words, if my math is correct and my assumptions aren't too lame, 112,000,000,000,000,000,000,000,000 photons strike each square centimeter a million light years away. Yowza!

      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    7. Re:Photons by nacturation · · Score: 1

      Crap, my math isn't correct. Forgot, oh, about a factor of 10E25 in squaring for the surface area. So that's now about 1,120,000,000,000,000,000,000,000,000,000,000,000, 000,000,000,000,000 photons per square centimeter. Double Yowza!

      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    8. Re:Photons by achurch · · Score: 1

      I'm not anywhere even close to a biology major, but curiosity killed . . . err, maybe I shouldn't use that one. Anyway:

      Some Googling on the subject says that light from Proxima Centauri reaches the human eye at about 100 photons per second. Proxima is about 4.2 ly ~= 4e16 m away from us, so we're on a sphere of surface area 2e34 m^2. I don't have a mirror handy, but let's say the human eye (pupil) has a surface area of 20 mm^2 = 2e-5 m^2. So Proxima is putting out 1e2 * (2e34/2e-5) = 1e41 photons per second.

      Proxima is a red dwarf, so let's say for the sake of argument that it's spitting out 700nm photons, with E = hc/l = 6.6e-34*3e8/7e-7 = 2.8e-19 J; that gives is 2.8e22 J/s of output. Einstein says E=mc^2, so m = E/c^2 = 2.8e22/9e16 = 3e5 kg/s.

      If you actually use these numbers for anything, you're insane, and I refuse to furnish you with two million hamburgers a second.

    9. Re:Photons by VC · · Score: 1

      I believe that it has been proven that the eye can, detecet under ideal circumstances, a single photon.
      And the brain does some pretty funky things with persisting objects in "the minds eye" if they dissapear for a short amount of time.
      Your point however is still valid. Its a *lot* of photons.

    10. Re:Photons by cheekyboy · · Score: 1

      Add a bit of LSD and the 'minds eye' becomes a lot longer, hence the visual trails, and audible echos and deeper colors and even memory ripples in your brain.

      Totaly WILD!!

      Not trying it, is like never leaving your house for your whole life.

      --
      Liberty freedom are no1, not dicks in suits.
    11. Re:Photons by Anonymous Coward · · Score: 0

      Go outside (No, it won't kill you) and look up at a bright star.

      Didn't your mother tell you not to stare at the sun?

    12. Re:Photons by myc_lykaon · · Score: 2, Funny
      It's an evolutionary limit of sorts.

      I think it's more a physical limit, unless you can detect photons that aren't there.

    13. Re:Photons by Anonymous Coward · · Score: 0

      I was just thinking, if there was a threshold to how many photons are needed this could result in pretty blurry vision in low light or fast moving situations.

      The rods would be stimulated by the photons bounced off from different "images" or a different "field of view" merging stuff together. This would be enhanced in fast moving situations or in low light conditions because you then need more photons so more time to build up the image you see.

      So evolutionary it is pretty logical, otherwise we wouldn't be able to hunt, drive cars let alone go out at night.

    14. Re:Photons by jcupitt65 · · Score: 2, Informative
      I remember doing an experiment in Physics at school to show this. Here's what we did:

      • get an LED, a variable power supply and a sensitive ammeter
      • sit with this stuff in a completely darkened room for 10 minutes so your eyes adapt
      • sit a known distance (eg. 1 meter) from the LED and slowly turn down the power until you can only just see it
      • wait a bit, try looking with your peripheral vision, wait a bit more, you'll find you can turn it down further
      • there's a point where if you concentrate you can still just guess where the LED is, stop there

      Now: assuming the LED is 100% efficient (close enough) and that your pupils are (eg.) 1 square cm at (eg) 1m from the source, you can calculate how many photons / second were entering your eye.

      Of course we were young (hmm, 17?) and this is only an order or magnitude experiment, but most people could go down to somewhere around 1 - 10 photons / second.

    15. Re:Photons by Suidae · · Score: 2, Interesting

      I've seen information that rods are somewhat slower than cones, so that fast moving things in dim lighting can appear behind their actual position (I suspect that our brains make up the difference so we can still catch thrown balls, ect).

      You notice it when there is a small bright light source on a moving object in a dim area. For instance, one of those bouncy balls with flashing LEDs embedded in them. If the ball is rolling across the floor, sometimes the flashes will appear to slightly preceed the ball.

    16. Re:Photons by Geoff-with-a-G · · Score: 1

      According to one of my Psych professors, under ideal conditions the human eye can detect a single photon.

      According to all of my Engineering professors, ideal conditions never actually occur in real life.

    17. Re:Photons by RollingThunder · · Score: 1

      I think you're a bit confused - your calculation is talking about "just seeing" it, at 100/cm^2, and then your final figures are still in per cm^2.

      I think you need to drop the "per surface area" part. Your calculation looks to be trying to figure out how many photons are emitted in total, not how many are hitting per square centimeter. How many are hitting per cm^2 is your -start point-.

    18. Re:Photons by corngrower · · Score: 1

      I don't know about a single proton, but IIRC it's not very many.

    19. Re:Photons by Braintrust · · Score: 1

      Weird. I haven't done any calculations, and I arrived at the EXACT same number in my conclusions... I blame the space vampires.

      --
      Years later, a doctor will tell me that I have an I.Q. of 48, and am what some people call "mentally retarded".
    20. Re:Photons by jafuser · · Score: 2, Funny

      Go outside and look up at a bright star.
      I suppose a disclaimer should be made for our sun being an exception. =P

      --
      Please consider making an automatic monthly recurring donation to the EFF
    21. Re:Photons by richie2000 · · Score: 1

      :-) Not really. Just up the amount of photons and decrease the size of the sphere. But it's not as immediately mind-boggling since the distances involved are so much smaller.

      --
      Money for nothing, pix for free
    22. Re:Photons by Anonymous Coward · · Score: 1, Funny

      > Any biology majors here care to tell me how many photons the eye needs to 'see' a reasonably bright star? With that information, you can calculate the rest (left as an exercise for the reader).

      42 ?

    23. Re:Photons by nacturation · · Score: 1

      You're right... it was late and my brain clearly wasn't working very well. I started with an estimate of 100 photons per square centimeter at a distance, but the final result is the total number of photons for the entire sphere surface area at that distance.

      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    24. Re:Photons by dododge · · Score: 1
      I've seen information that rods are somewhat slower than cones, so that fast moving things in dim lighting can appear behind their actual position

      In fact there's a commonly-used technique that takes advantage of this response lag to simulate 3D in ordinary video or film content. Google for "Pulfrich".

  19. the newest smart-virus by kjba · · Score: 2, Funny

    "The plan is to run the program on a zillion machines for a month and combine the results. All you have to do is run it and when the deadline arrives, email me a compressed file of the cache directory. So email me here and I'll send you the zip file. The deadline will be June 1st 2004."
    I wonder if this works better than pictures of naked women...

  20. Oh boy... by MosesJones · · Score: 5, Insightful


    He needs networking connection, a decent threading model and doesn't want to crash your box.

    So while he could spend a huge amount of time doing all these basic things in C and still have major risks for the people running it, he has chosen to use the right tool for the job.

    Also the Maths libraries are IEEE compliant in Java and not in C on the PC, so I'm assuming that also played in to his reasoning.

    --
    An Eye for an Eye will make the whole world blind - Gandhi
    1. Re:Oh boy... by Anonymous Coward · · Score: 0

      I could see the IEEE-point in bignum trickery, but what part of raytracing relies on getting the last few bits right?

    2. Re:Oh boy... by cheekyboy · · Score: 1

      With todays tools and profiling and exception handeling, your C++ code should NEVER crash, but fail safe.

      Ofcourse, java is the 'im a slob of a programmer that cant write good code' language.

      And btw there are many IEEE complient libs/classes in C++.

      But having said that, the java app makes a good model/proof of concept v1 release, that would be ideally suited for C++ porting (at least the intensive maths bits)

      --
      Liberty freedom are no1, not dicks in suits.
    3. Re:Oh boy... by pla · · Score: 4, Insightful

      He needs networking connection, a decent threading model and doesn't want to crash your box.

      False, on all of the above.

      For "networking", users will manually send him their cache directory (as the FP explicitly stated). As for threading... To do what? He wants to run a completely straightforward trajectory simulation, iterated a few "zillion" times. I'll admit that I have a bias against most uses of multithreading and consider them inappropriate 99.9% of the time, but if you can even force them onto this project, you need to go back to the drawing board.



      So while he could spend a huge amount of time doing all these basic things in C and still have major risks for the people running it, he has chosen to use the right tool for the job.

      Umm... Yeah, whatever. He wants to run a CPU-intensive background process, performing a totally straightforward set of calculations, and nothing else. No GUI (beyond a few simple controls to make it play nice), and nothing server-side - sounds like a perfect candidate for anything but Java.

      Personally, I'd say this even sounds like a good candidate for hand-tuned assembly. But then, at least from my alma-mater, they don't even require that to graduate in CS anymore. Sad... And people actually wonder why tech jobs keep heading for India. Well, the FP and you just provided a nice answer - Using Java for a tightly CPU-bound problem? Using threads for the same (Ever heard of "cache consistancy"? Yet another reason to avoid multithreading in a program of this nature)? Why not just downgrade to a 486? Same effect, less complex.

    4. Re:Oh boy... by cheekyboy · · Score: 1

      He only needs 2 threads.

      if( NumOfCPUS() > 1 )
      {
      fork();
      }

      DoMySlowJavaCode();

      --
      Liberty freedom are no1, not dicks in suits.
    5. Re:Oh boy... by joib · · Score: 2, Informative

      This presentation explains the problems with Java floating point.

      Incidentally, C99 has very nice support for IEEE 754 (improved numerics support was, in fact, one of the biggest additions compared to the old C89 standard).

    6. Re:Oh boy... by ultranova · · Score: 2, Interesting
      As for threading... To do what? He wants to run a completely straightforward trajectory simulation, iterated a few "zillion" times. I'll admit that I have a bias against most uses of multithreading and consider them inappropriate 99.9% of the time, but if you can even force them onto this project, you need to go back to the drawing board.

      There's this thing called SMP, which lets you have multile CPU's in one machine. But, to take any advantage of it, you'll need one thread per CPU.

      Personally, I'd say this even sounds like a good candidate for hand-tuned assembly.

      Tuned for what processor ?

      But then, at least from my alma-mater, they don't even require that to graduate in CS anymore.

      Apart from compiler writers, who needs hand-tuned assembler ? It's impossible to port without a complete rewrite, difficult to upkeep, and you'd need to retune your programs every time a new processor comes out.

      Developer time is better spent optimizing algorithms than performing mechanical tasks that the computer can do for you.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    7. Re:Oh boy... by Anonymous Coward · · Score: 0

      There's this thing called SMP, which lets you have multile CPU's in one machine. But, to take any advantage of it, you'll need one thread per CPU.

      Ever heard of fork() dumbass? Or running the program twice if you have 2 CPUs? No? Well I guess you're a fucking retard then aren't you. Bitch.

      Tuned for what processor?

      x86, sparc, ppc, etc. The other archs can use generic C code.

      Apart from compiler writers, who needs hand-tuned assembler ? It's impossible to port without a complete rewrite, difficult to upkeep, and you'd need to retune your programs every time a new processor comes out.

      Yes I'm sure BILLIONS of new CPUs will come out within the next month, fucker.

      By the way, have you looked at GMP? Wow, assembler optimizations for several different archs. I wonder how they did that, since it's IMPOSSIBLE to port.. ooh.. I guess it is possible.

      Fuck off.

    8. Re:Oh boy... by Tet · · Score: 2, Insightful
      Apart from compiler writers, who needs hand-tuned assembler ?

      You do. If you can't write assembly language, then you will never be as good a programmer as those who can. Whether you actually use it is another matter. I haven't had to actually write anything in assembly language for well over a decade. But the fact that I could if I needed to helps, even when writing in a higher level language, because I have some clue about what's going on under the covers.

      --
      "The invisible and the non-existent look very much alike." -- Delos B. McKown
    9. Re:Oh boy... by theotherfish · · Score: 1

      There's some more in-depth (and less dramatic :) information on Java's fp handling here: http://servlet.java.sun.com/javaone/resources/cont ent/sf2002/conf/sessions/pdfs/1079.pdf (written by the co-author of the original "How Java's Floating-Point Hurts Everyone Everywhere" paper, who is now Sun's "Java Floating-Point Czar") - it looks like the problems aren't as serious as they were initially made out to be.

    10. Re:Oh boy... by David+Leppik · · Score: 4, Insightful
      He wants to run a CPU-intensive background process, performing a totally straightforward set of calculations, and nothing else. No GUI (beyond a few simple controls to make it play nice), and nothing server-side - sounds like a perfect candidate for anything but Java.
      Except that what makes Java slow is its do-it-yourself GUI and run-time object management. Those disadvantages mostly go away if you program Java as if it were C: use and re-use arrays of primative types in preference to short-lived objects, and cluster things together in memory (via arrays) when they are used together. The just-in-time compiler will convert the bytecode into machine instructions on the fly, using information that's not available at compile time.
      Personally, I'd say this even sounds like a good candidate for hand-tuned assembly.
      Okay, I'll bite. I've got two macs and to Linux boxes here. Each has a different processor architecture (Celeron, Athalon, G3, G4.) I don't know much about hand-tuning for x86, but on the G4 you shove your floats into 128-bit vectors and do your ray tracing in chunks of four floats. The G3 lacks the vector coprocessor, so you'd optimize it in a very different way.

      Besides, by writing in Java and not hand-written assembly, he gets to run it on machines like mine, which probably weren't the original target platform. The name of the game in distributed processing is to use as many spare processors as possible, even if some are slow. An hour of work to promote his project is more likely to pick up 10% more (or 1000% more, with \.) CPUs than an hour of hand-tuning assembly is likely to get 10% more speed out of a particular processor.

    11. Re:Oh boy... by Too+Much+Noise · · Score: 2, Informative
      Apart from compiler writers, who needs hand-tuned assembler ? It's impossible to port without a complete rewrite, difficult to upkeep, and you'd need to retune your programs every time a new processor comes out.

      This is a very special case he has - HPC. It's one of the few that actually do benefit from hand-tuning optimizations in some places.
      • you hand-tune for your main workhorse arch - that would be mostly for weird cases to use vector units (think SSE1/2/3 or AltiVec) so not a large amount of asm is required. Use #ifdef's if more than one platform is needed. Yes, it's a complete rewrite, but only if moving to a different arch and even then, only if you need asm again (compiler not doing the needed optimization automatically)
      • difficult to upkeep - not really, unless it's poorly written and you need to redo it. Comments help, as usual. Also, for some things compilers give you intrinsics to access the low-level features of the cpu, so you can do them C-style.
      • How often does a processor come out? if you have to run a large simulation and if (notice the if here) hand-optimizing some operations in the main loop can move it from a one-month run to a one-week then you should definitely do it as you can then have a broader results base to use, and quicker. It requires some thought and knowledge about what you're doing, but that's not new.


      The asm optimization is optimizing algorithms. It usually is the last stage, when you still need to squeeze more speed after all the high-level optimizations. Not very often, but it still happens (see openssl use of asm for instance; heck, even ATL/WTL - that's a Windows C++ template class lib - uses a couple of asm lines).

      So no, asm is not dying outside compiler writers ... and of course kernel/driver writers which you forgot to mention ^_^
    12. Re:Oh boy... by pla · · Score: 1

      There's this thing called SMP, which lets you have multiple CPU's in one machine.

      One could simply run the program twice... That style of use (two CPUs so two threads) illustrates what I mean - Many people would think nothing of tossing off a new thread, despite the need for absolutely no communication between the two threads/processes. Why?


      Tuned for what processor?

      P4, then Athlon, then P-III, then a tight generic C version as a fallback. Although P4 actually includes three (four, now?) significantly differernt chips, the Athlon includes four, and the P-III includes two , we can safely ignore those differences since this task could probably fit its entire core routine's data in L1 cache. As for other architectures - First of all, I can absolutely guarantee that you'll get a far higher total volume of work done just by specifically optimizing for 80% (RNPOOMA) of desktops running one of those, than by dragging the whole thing to a crawl just to allow the other 20% of desktops to also run this program.

      Now, if he knows he'll have a very large number of Sun IVs or G5s or the like running this, it would make sense to support that. But barring that, from the stated purpose of this run, he'd do better to completely ignore them (or at most provide a vanilla C version) and focus on what most of his target userbase actually has.


      Apart from compiler writers, who needs hand-tuned assembler?

      People interested in "recreational mathematics" programming, exactly like this particular project. People who fully expect to take a few centuries of CPU time spread across hundreds of machines.

      To give me some credibility here, I recently finished just such a run myself, searching for Lychrel seeds. Racked up 30+ years of CPU time, and just the postprocessing to get the results in a meaningful form will take four months (can't distribute that, unfortunately, so four "real" months).


      It's impossible to port without a complete rewrite, difficult to upkeep, and you'd need to retune your programs every time a new processor comes out.

      I specifically mentioned my recent project (above) for one reason - I did port it mid-project. We started off targetting only Windows machines, but suddenly needed to support Linux. Total time for the port? Three days. If I hadn't stupidly used GetFileAttributes() rather than the tried-and-true (and portable) stat() call, the port would have taken under an hour. Once it ran on Linux, we could have run on any machine that supports Linux.

      Now, you may say, Linux on a P4 has the same CPU tuning as Windows on a P4. True. However, "supporting" a platform doesn't mean you need to waste hundreds of hours optimizing for that platfom. You might only have a single client program on obscure-platform-X, why waste time?


      Developer time is better spent optimizing algorithms than performing mechanical tasks that the computer can do for you.

      You go right ahead and figure out a better way to track particle trajectories. Perhaps I'll read about you making a fortune by writing the next big 3d game engine. In the mean time, in terms of accomplishing a specific goal, taking the current best and making an optimized implementation will get the job done. And while, in another decade you may still not have built a better mousetrap, this project will have finished, published, and perhaps started gearing up for a "Mega-zillion" iteration run.

    13. Re:Oh boy... by Wateshay · · Score: 1

      You forget, though. Around here, the best solution is always the technical solution. A non-technical solution (like promoting your project to get more users) is boring. You're much better off spending forty more hours hand tuning the software to run optimally on every processor out there. /sarcasm

      --

      "If English was good enough for Jesus, it's good enough for everyone else."

    14. Re:Oh boy... by eric76 · · Score: 1

      You are exactly right.

      Given two or more programmers looking for a job who are otherwise nearly equal, I'd hire one who knows assembly over the one who doesn't.

      Assembly languaged used to be my favorite language for doing anything. Unfortunately, it is rare that I can use assembly language in my usual software development projects.

    15. Re:Oh boy... by StoatBringer · · Score: 0

      That document says it was "Originally presented 1 March 1998". Java has changed quite a bit since '98.

      --
      Cress, cress, lovely lovely cress
    16. Re:Oh boy... by Anonymous Coward · · Score: 0

      Personally, I'd say this even sounds like a good candidate for hand-tuned assembly. But then, at least from my alma-mater, they don't even require that to graduate in CS anymore. Sad..

      Yeah, and in 5 years when you have the assembly program done you can maybe run your simulation. Oops, you didn't count on a particular architecture out there.

      Complaining about people not knowing assembly in CS is like complaining that architects don't dig ditches.

  21. I am so in on it by the_thunderbird · · Score: 1

    I could spare a few cpu cycles during the day while I am at work and from about 1am till I get home from the office :-D

  22. Re:No posts and the site is already slashdotted. by martingunnarsson · · Score: 1

    It was slashdotted even before it went public! Or perhaps the URL is bad?

    --
    Martin
  23. Re:Java is a slow cruncher by LarsWestergren · · Score: 4, Insightful
    He sounds like a clever guy, but "pure Java" for number crunching!?! With "pure C", it'd take half the time with half the number of computers.

    ...but he would have to spend a lot more time porting it between different architectures and OSes. God, how many times do you have to explain this to people? These days, processing cycles cheap, programmer time expensive.


    FP ops in Java are incredibly slow and broken.


    Er, do you have any more recent numbers than a lecture from 2001, originally published in 1998??
    --

    Being bitter is drinking poison and hoping someone else will die

  24. Re:Java can be faster then C sometimes by Metallic+Matty · · Score: 3, Informative

    Either I'm suffering deja vu, or this has been posted nearly verbatim before in a previous discussion of Java vs. C.

    Astounding.

  25. Explain picture by miike · · Score: 5, Interesting

    I would like to know what I see in the picture before I dedicate my cycles to the project. What are those "bubbles" in the pic for example?

    1. Re:Explain picture by rkeene517 · · Score: 5, Informative

      The old 1994 picture is of a cubic room with mirrors on the near and far walls. The 'bubbles' are refletive spheres. A beam of light comes out of the left wall, hits a prism and forms a spectrum on the right wall. The depth of field is very shallow so only objects exactly on the focal plane are in focus. The black fuzzy blob is the camera aperature, out of focus, being reflected in the far mirror. There is an error in the image. The corners of the room are bright and should not be. This is due to a poorly chosen diffuse scattering model. The current project is an almost identicle setup, with 1/4 as big of aperature. I have done about 1 billion photons on my 3 computers, and the new image looks much cleaner. I expcet it will take about a trillion photons to make a realy smooth image.

      --
      Inside every complex program is a simple solution trying to get out.
    2. Re:Explain picture by jafuser · · Score: 1

      This is actually fascinating on a geeky level. How do photon-simulated images compare to raytraced images?

      Would the following be a fair statement?

      photon simulation : raytracing :: raytracing : texture mapping?

      --
      Please consider making an automatic monthly recurring donation to the EFF
    3. Re:Explain picture by Anonymous Coward · · Score: 1, Informative

      Ray tracing just means following the path of a ray for simulation. It's not just for graphics. However in graphics it normally refers to just following a) at least one "eye" ray from each pixel in the camera, b) reflective rays, and c) direct illumination rays to the lights.

      This gives the simple raytraced scene that you are probably thinking of.

      What are missing are diffuse rays: light from other objects that aren't lights and aren't in the direction of a mirror bounce. Gathering all the light is known as the global illumination problem.

      There's lots of way to handle this including radiosity patches and monte carlo ray tracing.

      It looks like this guy is doing some type of monte carlo ray tracing while properly taking into account wavelengths (i.e. not RGB but lamba) and many bounces instead of just direct or only X levels. He may also be tracing from the light out instead of the camera back.

      I'm not sure if he's doing any stratified sampling or bundling of photons but it would help speed things up if he's not.

  26. Re:Wireless or not... by MrLizardo · · Score: 0

    Hmm, it would be very interesting if it could be used as a form of payment. For example at a University you might be able to run the a client that would do the number crunching on some of the on campus research projects. In return you'd get $500 waved off of your housing fees. The money that the University didn't have to pay to buy another super computer could be used to help lower tuition, or cost of books or cost of food. On a more global scale, you could, say get DSL through AT&T, install AT&T's distributed computing client and get $10 a month knocked off your bill.

    It would also help us geeks justify the rediculously fast hardware we buy. It would almost make computer hardware closer to an investment than a money sink. Now I'm just dreaming.

    -Mr. Lizard

    --
    ^I'm with stupid.^
  27. Trust? by wan-fu · · Score: 4, Insightful

    What's to insure the trust within this project? Call me a cynic, but what's preventing some jerk from swapping some bytes in his set of data before sending it off, thus, rendering your combined result different from what you intended?

    1. Re:Trust? by Alsee · · Score: 2, Informative

      He's mapping out millions of independant random photons. A handful of stray photons out of millions would have no visible effect. It's not a problem unless you submit a pretty massive number of bogus results. And if the effect was noticible it could probably be traced back you your currupt batch and simply tossed. Tossing data does not currupt the result, it just makes the final image a tiny bit dimmer.

      -

      --
      - - You can't take something off the Internet! That's like trying to take pee out of a swimming pool.
    2. Re:Trust? by b4rtm4n · · Score: 1

      If its really important to get accuracy he could do it seti style. Identical workunits handed out to several different users. Those WU's should all comeback with identical results. Any variations can be tossed.

      --
      "goatse? What's that? Anyone have a link?" - AC
    3. Re:Trust? by BalloonMan · · Score: 1

      "It's not a problem unless you submit a pretty massive number of bogus results."

      As the folks at dnet.com found out the hard way, it's a whole lot easier to post a massive number of bogus results if you don't care about the accuracy of your results. There was a dnet scammer posting junk just to get his name to the top of the list of contributors. His rate of results "production" was limited only by his network bandwidth to the dnet server. This necessitated some changes in dnet that anybody contemplating anonymous distributed computing must consider.

      1. Always maintain the source of individual results throughout the entire calculation. You never know when you will have to go back and remove a subset when you find out they are bogus. Same goes for which version of the software they used, in case you find out you screwed up.

      2. Arrange for a small but guaranteed amount of duplication in the task subsets that you distribute, then compare the results of the duplicated tasks. Then when the bogus stuff turns up, you'll be able to flush it (see point 1).

    4. Re:Trust? by rkeene517 · · Score: 3, Informative

      I will be combining the result in a graphical tool that lets me look at each submission before it gets summed into the result. This will at least prevent some pr0n picture from getting merged in. Also a few bad submissions or duplicates will not throw off the total results.

      --
      Inside every complex program is a simple solution trying to get out.
  28. Povray ? by dargaud · · Score: 1

    This image looks like something you could do in under 500bytes of PovRay code... Anyone cares to comment on the difference ?

    --
    Non-Linux Penguins ?
    1. Re:Povray ? by chrispl · · Score: 1

      This is a very accurate simulation of actual light and optics, calculating the properties of every photon. Most renderings you see use a lot of tricks and shortcuts to achieve a similar effect but this one is much more accurate to whats happening in real life.

      Well thats what Id assume at least by reading the CPU power it took to render it...

      --
      What post? The one you're carrying inside your rusty innards!
    2. Re:Povray ? by Anonymous Coward · · Score: 2, Informative

      Ray-tracing traces rays from the eye towards the lights and uses this to simulate how bright a light you see for each pixel. This is great for some things, but isn't realistic, as many lighting effects can't be simulated. Radiosity fills in some of the gaps, but there's still a lot missing. For example if you shine a light onto a mirror at 45 degrees (specular reflection), it won't make light shine onto a diffuse surface at 90 degrees to the mirror, which it would do in real life.

      Photon simulation does the opposite of ray tracing and traces the paths of photons leaving the light source and calculates where each photon would hit the view plane if at all. It takes a lot of calculation because you have to send of millions of photons in all directions from the light sources. You can simulate all known light effects this way, just very very slowly. In the image you can see light shining from the light source onto the rear mirror and bouncing off onto the diffuse surfaces at the side.

      Both are great for parallel processing because each photon/ray is pretty much independent of others.

    3. Re:Povray ? by Anonymous Coward · · Score: 0

      >Both are great for parallel processing because each >photon/ray is pretty much independent of others.

      I was wondering if he was doing something like this. So he's using the pseudo-random number generator to generate a photon, simulating it's complete path, and dropping that into a data file. Lather, rinse, repeat.

      I've got to wonder, will the low-quality of most pseudo-random number generators introduce any unwanted effects into the picture? (IE a moire pattern or some such because there are bands of photons that *cannot* be created.)

    4. Re:Povray ? by Anonymous Coward · · Score: 0

      You can use Povray only if you knwo what the
      picture should look like. The guy wants to
      _simulate_ something, thsi means he downt know
      what the result will be. According to
      your logic, you can replace all the expensive
      simulation suites like mentor graphics etc. with
      gnuplot and 200 bytes of script - you only have to
      know what the graph will look like :-)

      Regards,

      anonymus coward

    5. Re:Povray ? by imroy · · Score: 4, Interesting

      I'm just guessing here, but it sounds like he's doing forward ray-tracing on the whole scene. Conventional ray-tracing traces the light rays backwards, i.e from the camera/eye out into the scene and finally back to the light(s). The only problem is that it doesn't really do caustics or diffuse lighting well. POVray faked caustics in version 3 (IIRC), and Radiance has done excellent diffuse lighting using a monte-carlo simulation for about a decade. In recent years photon maps have also developed. These apply forward ray-tracing to selected areas, usually selected refractive and reflective surfaces. The impact points for the photons are recorded and then used in a regular renderer (either scan-line or ray-tracer) as an additional source of light.

      Again, it sounds like this guy wants to do this to the whole scene, and to a very high degree of precision. I'm not sure why. Any decent ray-tracer would get a 99% solution in a fraction of the time. Hell, in good hands even scan-line renderers can get a 90% solution even quicker, just look at all the motion-picture visual effects (and whole movies) rendered with Pixar PRman. Most effects don't even need a good ray-tracer to look realistic to most people. Unless he's rendering something more interesting than shiny balls and a mirror, or going to do something interesting with the trillions of photons (near-real-time camera-independent renders?), I really don't see the point. It's still kinda interesting though, if only because of the scale of the work. It might lead somewhere, you just never know.

    6. Re:Povray ? by forkazoo · · Score: 1

      A lot of people seem to be assuming that the guy is some sort of moron. AFAICT, he really was published, about ten years ago, and now is recreating his work on modern hardwrae by way of comparison. If all he wanted to do was make an interesting picture, then yes, there are lots of extant renderers that will make pictures. This guy is a graphics researcher. He is interested in techniques that haven't been adequately explored.

  29. Trillion cycles? by Moderation+abuser · · Score: 1

    That's like what... 3-4 seconds? A few trillion being 12-15 seconds these days. Are you sure that's all that's required?

    --
    Government of the people, by corporate executives, for corporate profits.
    1. Re:Trillion cycles? by Anonymous Coward · · Score: 0

      No, that would be a 10 billion cycles. A trillion is more like 10 minutes or so.
      (or 20 years on civilized continents..)

  30. All this effort for THAT? by Anonymous Coward · · Score: 0

    Can anybody explain me what in the world can be learned from the picture like that?

    Second, to add to discussion of: "java is slow": Actually, thanks to JITs, it can be acceptably fast (near to C speed, sometimes even faster(!)), but, at least once upon the time Java's main problem for floating point calculations was described in

    William Kahan's "How JAVA's Floating-Point Hurts Everyone Everywhere" (http://www.cs.berkeley.edu/~wkahan/JAVAhurt.pdf)

    Does anybody know the current state of the problems described there?

  31. Surprisingly... by nfabl · · Score: 1

    The human eye can detect a single photon, thats enough to trigger the rest of the stimulation pathways.

    But to actually see a star, well, i'd guess more than 1. :P

  32. The value isn't in the cycles... by emtechs · · Score: 1
    If he really wanted to take advantage of the audience he should publish the source code. I'm sure someone would have it running in every language you could want.

    Of course if you put any kind of counter on it and post the results you could get various hardware hackers competing. Getting a pretty picture might be more interesting than RC5 cracking.

  33. Missing the point by Anonymous Coward · · Score: 0

    He chose Java for portability, not performance.

    AC

  34. Re:Java can be faster then C sometimes by Metallic+Matty · · Score: 1

    Thought I recognized it. I wasn't sure if I was losing my mind or if it was just getting a bit too late. (4:30am here, lol.)

  35. Photon Soup: Longer and Uncut by Xenoproctologist · · Score: 5, Informative

    A much larger version of the SIGGRAPH `94 image "Photon Soup", clocking in at 840x560, can be found HERE.

    1. Re:Photon Soup: Longer and Uncut by Handpaper · · Score: 1
      Errr.. They're the same res. The Hamburg version has black bars left and right, and the authors copyright notice at the bottom - that's all.

    2. Re:Photon Soup: Longer and Uncut by rkeene517 · · Score: 3, Informative

      That image is a photograph of the slide that was in the SIGGRAPH 95 slide set.

      --
      Inside every complex program is a simple solution trying to get out.
    3. Re:Photon Soup: Longer and Uncut by Anonymous Coward · · Score: 0

      This is crap, you can draw things like this with blender and gimp effects. You know how it will look anyways so why bother spending CPU cycles of many machines that could be used better?

  36. which would you rather run? by theguywhosaid · · Score: 5, Insightful

    wow, its slower than C. i'd rather run a random java app than a random native app because you can easily sandbox it and know its not going to screw your computer. thats one less barrier to people helping the dude out. and theres no recompile for the various linux platforms, win32, solaris, macOS, etc etc. its certainly slower, but more friendly to the community.

    1. Re:which would you rather run? by cheekyboy · · Score: 1

      So where is this new 4000x4000 image generated by java, if its that fast, it should have been finished by now, his old C code would have finished 12 minutes after posting the story ;)

      --
      Liberty freedom are no1, not dicks in suits.
    2. Re:which would you rather run? by Anonymous Coward · · Score: 0

      and not only is it easy to sandbox, but it's dead easy to reverseengineer java bytecode ;-).

    3. Re:which would you rather run? by quelrods · · Score: 0

      unless you run on an unsupported platform? sun java only supports linux/windows x86 (32bit), solaris sparc/sparc64 talk about portable...in order to run java on my freebsd laptop i have to use linux binary emulation to run the x86 linux sun java port...Come to think I can't name a single programming language that is less portable.

      --
      :(){ :|:&};:
    4. Re:which would you rather run? by PantsWearer · · Score: 1
      Come to think I can't name a single programming language that is less portable.

      There's your problem. Think of java more as an executable than a programming language. C is exceedingly portable, but if I pass you my OSX executable compiled from C, your freebsd laptop won't run it. In fact, it'll only run on other OSX installs and that's if I didn't set my compiler flags to something so specific that it would only run on my particular processor generation.

      --
      Be glad life is unfair, otherwise we'd deserve all this.
    5. Re:which would you rather run? by quelrods · · Score: 0

      i think you missed the point... if i want to run linux on ppc i'm out of luck if I want to use java...the language AND the executable are unsupported by sun's java. Yes the java compiled byte code is portable in the sense that there is no recompile, but that assumes the jvm even runs on the machine...if it doesn't the point is mute.

      --
      :(){ :|:&};:
  37. Re:Java is a slow cruncher by blinkie · · Score: 3, Insightful

    Erm, that article is more than SIX years old, and one of the guys that wrote it now works for Sun. Apparently FUD is not something Microsoft has monopolized yet..

    --
    to^2
  38. Impractical by Anonymous Coward · · Score: 0

    Who's interested in a technique/algorithm that takes many month-machines?

    Personally if I were a siggraph reviewer I'd reject this submission as "impractical".

    Now is the right time to publish the 1994 algorithm, and when computers get another 3000 times faster it will be the right time to publish *this* article.

    This is assuming that no one can do better with less in the meanwhile, which is probably what will happen.

    So this stuff is worthless now, and will probably be worthless in the future too.

    1. Re:Impractical by rkeene517 · · Score: 1

      In fact in 1994 the SIGGRAPH moderators rejected the article but published the picture. The reason I did the rendering in 1994 was mostly "because it's there" and had not been done before. So why do it again now? First of all, "because it's there". Second, there are a new breed of graphics cards comming out soon that will do ray tracing in hardware. This brute force approach may not be so far fetched.

      --
      Inside every complex program is a simple solution trying to get out.
  39. Mother Goose by Anonymous Coward · · Score: 0

    the .gif is slashdotted at frickin' 3:30am

    1. Re:Mother Goose by dew-genen-ny · · Score: 2, Funny

      330am your time buddy.

      It's the middle of the morning here in europe and we've taken over the slashdotting duties while you guys get some shut eye.

      --
      tom-george.comBecause geeks rate higher t
  40. Could you please configure your server properly? by francium+de+neobie · · Score: 2, Informative

    Your site is returning gibberish on my Mozilla, and here's the wget output...

    [snip]

    Found www.cpjava.net in host_name_addresses_map (0x8074330)
    Registered fd 3 for persistent reuse.
    Length: 71,283 [text/plain]

    [snip]

    Apparently your server is sending out .gifs as plain text file and screwing up browsers.

  41. power consumption by lightray · · Score: 4, Insightful

    The fact of the matter is that a machine with 100% CPU utilization uses a lot more electricity than one with low utilization. The extra cycles aren't free.

    I measured this in 1997 on some kind of AMD K6 machine. IIRC, running dnetc doubled the power consumption of the machine.

    1. Re:power consumption by Anonymous Coward · · Score: 0

      My own careful measurements indicate that leaving my PC on in order to run someone else's code uses infinitely many times as much electriciy as turning it off.

    2. Re:power consumption by Anonymous Coward · · Score: 0

      At work we used to have one of those seti freaks that would run it on our devel server. I could tell just by looking at the utilization lights on the ups whether he was running it. I would have larted the bastard but he was kinda my boss, though that didn't last for long :)

  42. Numpy is great, but... by XNormal · · Score: 2, Informative

    Numerical Python is great, but not necessarily suitable for this task. It's good when you're performing the same operation on the items of a vectors. When the vectors are long enough it indeed approaches the performance of C code. But in ray tracing every photon can take a different route depending on what it hits. I'm not so sure Numpy would perform nearly as well in this case.

    --
    Stop worrying about the risks of nuclear power and start worrying about the risks of not using nuclear power.
    1. Re:Numpy is great, but... by Dominic_Mazzoni · · Score: 1

      Numerical Python is great, but not necessarily suitable for this task. It's good when you're performing the same operation on the items of a vectors. When the vectors are long enough it indeed approaches the performance of C code. But in ray tracing every photon can take a different route depending on what it hits. I'm not so sure Numpy would perform nearly as well in this case.

      You're totally right of course that it does require you vectorize your code. I'm not convinced that you couldn't vectorize raytracing, though. Start with a vector of a million photons. Do some vectorized calculations to determine which object all of them strike first. Suppose a hundred thousand strike the first object - then run the next calculation on that subset, and so on. Heck, I've found that rewriting C code to work this way is often faster because it's cache-efficient.

    2. Re:Numpy is great, but... by aminorex · · Score: 1

      Raytracing is "embarassingly parallel", and
      bog-simple to vectorize. If you wrote a little
      SSE2/3D-Now native DLL you could vastly accellerate
      the Java for this case -- or you could just use the
      -server switch, so that hotspot generated SSE code.

      --
      -I like my women like I like my tea: green-
  43. Mod me off-topic by Merovign · · Score: 0, Offtopic


    What is it with the moderators today?!?!

    People are posting things like "gee this is a great idea" and getting modded as a Troll, people are
    posting simple and obvious and funny jokes and being modded as Flamebait!

    ?

    1. Re:Mod me off-topic by Anonymous Coward · · Score: 0

      It's telling that Java won't bear much criticism.

      Java: a reasonably interesting if rather old idea (the virtual machine), combined with a rigid and painfully verbose language whose main selling point is its brilliant innovation of the garbage collector. (Sun has since quietly stopped spouting the lie of "write once, run anywhere.")

      Java combines the blazing speed of Lisp with the power of VirtualBASIC and the neat and concise syntax of COBOL.

    2. Re:Mod me off-topic by Halfbaked+Plan · · Score: 1

      They can always sign up at Apple.

      Seems to be more money in that lately around here.

      --
      resigned
    3. Re:Mod me off-topic by richie2000 · · Score: 1

      I think they use some kind of religious reward system, ie they get an iPod after death or something like that.

      --
      Money for nothing, pix for free
    4. Re:Mod me off-topic by richie2000 · · Score: 1

      Or maybe they just get a dead iPod...

      --
      Money for nothing, pix for free
  44. Enter applet. by Kingpin · · Score: 4, Insightful

    Applets are bad for a LOT of things. But this is one thing they would work really well for. Using an applet:

    1. The client PC runs the program in a sandbox
    2. Most client PC's don't need additional software installed (if written for JDK 1.1)
    3. The user does not need to know how to invoke a Java application
    4. There's no administrative overhead in iniating the application, just go to a URL

    --
    Unable to read configuration file '/bigassraid/htdig//conf/14229.conf'
    Geocrawler error message.
    1. Re:Enter applet. by Anonymous Coward · · Score: 0

      Yeah, with Serializable Objects and RMI, it's possible to make a system that you just go to a web page, an applet loads, it sends some code to your system in the sandbox, and then waits for it to complete and then sends it back. There would be no hassle for a client with an up-to-date JVM, and to stop processing, you leave the website. The server doesn't update the to-do list until the completed data is returned and entered, so people can leave whenever they want. This requires redundancy, but redundancy can also be used to check for bad results.

  45. Re:Wireless or not... by Paul+Townend · · Score: 1

    This sounds similar to what some people (such as Entropia) are attempting on "The Grid" (see The Globus Project for more wiffly utopian detail on that).

    Of course, it also leads to problems. Like security - how much can you trust an autonomous node to return correct data?

    To what extent is there scope for malicious nodes deliberately returning incorrect results? And given the autonomous nature of the nodes, they can turn on and off (crash, be turned off) at any time and their performance will fluctuate depending on what other load (that you can't control) is placed on them, so you may want checkpointing and/or redundancy going on.

    Which leads to the question of how to co-ordinate it all to maintain consistancy should you wish to roll back. All very app-specific, to be sure, but it's the detail that prevents stuff like this from being used by more people.

    Blah!

  46. Anonymous grid computing by mec · · Score: 4, Insightful

    First there are resource allocation problems. The OS has to provide a sandbox with strict limits on all resources: memory, filesystem, and networking, as well as CPU time. It's fine with me if the "background compute demon" takes 25% of my processor but I don't want to take more than 10% of my memory.

    Then there's the security issue.

    But I see another problem which is even harder to solve: the tragedy of the commons. Consider a university campus, and suppose that anyone on campus can submit jobs to the Campus Grid. You come in the next morning and see that there are 10000 jobs in your grid queue, and 9800 of them are encoding random people's MP3's.

    The problem is that if you give free resources to a large anonymous community, it takes only a few of those people to suck up all the resources. So you need some way of identifying everyone who submits a job, and some way of charging for the jobs.

    1. Re:Anonymous grid computing by Lehk228 · · Score: 1

      How about a system where one master server controls who gets what project on the cluster, if you use the cluster for mp3 encoding then you lose access to the cluster except for requesting manual approval of the cluster admin if you later have an actual project, just make the rules no mp3's and no re-encoding movies into XviD.

      --
      Snowden and Manning are heroes.
    2. Re:Anonymous grid computing by MrLizardo · · Score: 0

      Just charge CPU cycle credits. Start everyone off with an allowance of a certain amount of CPU time. The more CPU time they contribute the more they get in return. The first week everyone will waste all of their CPU cycles encoding MP3s, then they'll have to earn them back by contributing before they can use any more. Granted this would create the need for a huge centralized server to keep track of this, and cryptographically signed clients, so that people wouldn't hack up their clients to claim they've done more work than they have.

      Its not really a "commons." Its a capatalism with the computers as the workers. The computers do work and for that work they earn credit. They can use the credit to hire other computers to work for them. It would get rid of the anonynimity, but it would prevent the "tragedy of the commons" scenario you suggested.

      -Mr. Lizard

      --
      ^I'm with stupid.^
    3. Re:Anonymous grid computing by eric76 · · Score: 2, Interesting

      Go a bit further and institute a bidding system for allocation of resources.

      For example, if I want to run some monster job and don't have the credits, I have to wait for credits to accumulate by letting others use my computer. Or I could submit a bid for the credits I have available in case the bid might win during a period when usage was light.

      The bid would include the total number of credits offered to do the job, the amount of processing power desired (number of processors, minimum processor requirements, type of processors, and maximum length of time per processor).

      During spring break when everyone is out of town, processing power could become cheap enough to run some really big jobs. Saturday night when everyone is out partying might give one a chance to run some reasonably large jobs.

      In other words, the bidding system would try to maximize utility by giving priority to projects that the submitter thinks highly enough to offer more credits to run the project.

      Add the ability to do checkpointing so you can restart the tasks being handled by one computer on another. An ability to migrate tasks from computers that suddenly become busy to other, less busy computers would be invaluable, too.

      Some method of transferring credits from one person to another would help. You might be able to obtain additional credits from others by mowing their lawn or something.

      It could be the basis for a whole new economy.

    4. Re:Anonymous grid computing by cyb97 · · Score: 2, Informative

      This might have been a problem back in the days, but today most computers are fast enough to make flac/oggvorbis/mp3's quicker than you'll be able to transfer the .wavs to a faster computer, let alone compress them and then tranfer them back.

      Most (all?) universities already have an authentication-system in place that is used on campus-computers, both for local and remote login. This can be applied to grid-computing, too. That way you can punish those who abuse resources like you already do if somebody decides to convert a couple of your loginservers into a CS/HL/Tetrinet/*-gameserver..

      At my university, the charge for CPU-cycles on the high-performance clusters isn't really related to the actual cost of cycles as these are dirty-cheap today, but the cost of administration of the system. In the case of using desktop/login-machines for grid-computing this should already be covered by the "dayjob" of these computers.

    5. Re:Anonymous grid computing by ashot · · Score: 1


      >First there are resource allocation problems. The OS has to provide a sandbox with strict limits on
      >all resources: memory, filesystem, and networking, as well as CPU time. It's fine with me if the
      >"background compute demon" takes 25% of my processor but I don't want to take more than 10% of my
      >memory.


      Wrap it up in a screen saver to only run on idle, and display some simple stats. Also, sending and recieving of data should be done intermitently during the idle times that way when the computer comes back, its instant.

      >Then there's the security issue.

      This is a knee-jerk reaction; There is NO security issue, sorry. Everytime you pop open an Applet or a Flash ad, your computer is performing other people's computation, and it has the capability of sending back information to their server; what is keeping that flash AD from f-ing you over? Simple, it can't save or access anything localy.


      >But I see another problem which is even harder to solve: the tragedy of the commons. Consider a ?
      >university campus, and suppose that anyone on campus can submit jobs to the Campus Grid. You come
      >in the next morning and see that there are 10000 jobs in your grid queue, and 9800 of them are
      >encoding random people's MP3's.


      How is this hard to solve? As has been said below, you need a login system with credits. This can be just like BitTorrent, in otherwords I can contribute to the system while I'm sleeping, and get back those credits when I am no longer idle. Or perhaps I can earn a small amount of money. Whats the going price on a cycle these days?

      Which actually brings me to a more intersting point. Instead of ads, another option would be to write a small flash app that would accept instruction bytecode from the server and execute and run it (in the ad) in the browser of the viewer of the computer; the ad of course can be invisible, so instead of viewing the ad you are supporting the company by providing perhaps 2% of your CPU time through that client. This is possible. ActionScript running numerical analysis, who would have thunk it? But it is Turing Complete after all =]

      This seems like such a great, yet obvious idea, so great and obvious that there must be an implementaion out there.. if not I'm going to tack this on as another one of my projects to implement such a system here on UT Austin..

      -Ashot

      --
      -ashot
    6. Re:Anonymous grid computing by Suburbanpride · · Score: 1

      The closest lab to my dorm contains 15 MDD dual processor G4s. At any given moment there are 2-3 people using Final Cut Pro, iDVD or some other processor intensive task. Another 3-4 computers have folks browsing the web or checking their email. The rest of the computers sit idle. It would be awesome if the folks using FCP could use all the other computers as a renderfarm. With xGrid [apple.com] and gigabit Ethernet, it doesn't seem like this would be hard to implement. The university paid for the computers, it might as well get full use of them.

      --
      sorry 'bout the mess...
    7. Re:Anonymous grid computing by Niet3sche · · Score: 1

      Riiiiiiiiiiiiight.

      Like this comment. ;) I really think this whole idea has merit. I know that when MY computer is just sitting around, I'd rather put the CPU to work for someone. And, likewise, when I need CPU time, I'd like to be able to reach back into the community and at least get out what I put in. More if folks feel up to it; break-even, if they don't.

  47. Re:Java can be faster then C sometimes by evanbd · · Score: 5, Informative

    Dude, is your C compiler that bad? I like Java a lot, and use it for compute intensive applications, but I think you're either pretty bad witha c compiler or trolling. if you're doing something CPU intensive in C, you need to use gcc -O2 (or -O3, depending), with -march=cputype. This will allow gcc to generate exactly the same code you just described, since it is not limited to 386 instructions. And if you need even more performance, you can just use Intel's C compiler for a lot of things (non-commercial is free as in beer), though it doesn't support some GNU extensions and I think has trouble with some things like the Linux kernel.

  48. Mod parent up by Wellmont · · Score: 1

    I agree, right now the people who would do this either:

    run SETI@home already :)

    or don't really like the idea of someone else benefitting from their pipe.

    It's very similar to the cable modem "hack" that can suck bandwidth out of a "cluster" of served modems...the people who would use it would tend to abuse it.

  49. you need to work on your java skills then... by Kunta+Kinte · · Score: 5, Informative

    My experience with numerically-intensive algorithms is that Java is 2-4x slower than C. You can get it within 2x of the speed of C if you ignore object-oriented programming and you're really good at Java optimization, but that's it. And it will run much slower on some architecetures because Java guarantees certain floating-point operation semantics at the expense of speed.

    The speed difference oft cited is about 20% on numerical apps. Check out http://www.idiom.com/~zilla/Computer/javaCbenchmar k.html. He brings up " Benchmarking Java against C and Fortran for Scientific Applications as well.

    You have to remember that Java's speed disadvantage is mainly in the JVM startup and GUI areas. Although a good Java dev team can make Swing fly ( checkout JBuilder for instance ).

    Java being Just-In-Time compiled can even take advantage make runtime optimizations that your C/C++ application may not.

    --
    Based on upvotes, Ageism is the only "-ism" Slashdotters care about and think isn't SJW
    1. Re:you need to work on your java skills then... by Anonymous Coward · · Score: 0

      Although a good Java dev team can make Swing fly ( checkout JBuilder for instance ).

      Stop it! Stop it! It hurts!

      Haaaaa ha ha ha ha ha haaaaaa

    2. Re:you need to work on your java skills then... by Anonymous Coward · · Score: 0

      If you repeat a lie for as long as Java's been out, people will actually believe it's that fast.

  50. Re:Insightful my ass by francium+de+neobie · · Score: 2, Interesting

    > pop AX
    > STOSW 0x0005
    > pop AX
    > STOSW 0x0005

    Are you still using Windows 3.1 + DOS 6.22 now?! No one compiles a C into "pop AX" in the 21st century x86s! We're all using the 32-bit registers instead of the 16-bit ones (i.e. EAX instead of AX).

    If your compiler is still giving this kind of output, grab a new one at
    http://gcc.gnu.org

  51. 3 cameras? by 91degrees · · Score: 2, Interesting

    Wouldn't it be just as fast to stud the entire wall with cameras? They're not even real, so you can have as many as you want in one place, and just duplicated the ray if it hits more than one lens.

    1. Re:3 cameras? by rkeene517 · · Score: 1

      That is correct. There is almost no extra cost in extra cameras or extra focal planes. I chose three so that the returned results are not too large. In fact you could simply record every photon that hits a wall, but the results would be huge.

      --
      Inside every complex program is a simple solution trying to get out.
  52. Re:Wireless or not... by fucksl4shd0t · · Score: 1

    I think this is a great idea! What is needed is some not-for-profit organization to oversee the open source project and ensure that all data that goes on the network is digitally signed and encrypted, to protect the generous souls hosting nodes as much as anything else. Who would be willing to take a crack at this? It's way out of my league right now, maybe in a few years, though...

    --
    Like what I said? You might like my music
  53. Re:Java is a slow cruncher by Anonymous Coward · · Score: 2, Insightful

    FP ops in Java are incredibly slow and broken.

    Originally presented 1 March 1998

    and ONLY 6 years have passed... no way they could have fixed any of those FP ops that were broken.

  54. Re:Java can be faster then C sometimes by Anonymous Coward · · Score: 2, Interesting

    Now, your C compiler will see that you want to store a 32 bit value, but has to generate code for a 386.

    Not if I distribute in source format.

    Hotspot is also capable of analyzing the running code and regenerating even better assembly that would perform poorly in other circumstances. For example, let's say Hotspot notices that the bounds can't be exceeded on an array. Well, Hotspot will then recompile to remove the bounds checking.

    In other words, your program can't take full advantage of whatever processor it's on because Java keeps analyzing/recompiling the code. The overhead is unacceptable to begin with (I can't imagine what it'd be like running this on a 386), but it's also variable. If you need to time your algorithm, Java with Hotspot isn't an option.

    Lastly, if you bother to swing by Sun's Java page, you'll notice that the 386 processors aren't even supported. If you need to run your Java program on a 386, you're shit out of luck.

  55. Re:Java can be faster then C sometimes by Avakado · · Score: 3, Informative

    Sorry, but the 80386 has 32 bit stack and move operations. Generally, people compile their program for 80386, because almost all optimizations that can be done automatically for Pentium does not harm performance on 80386.

    If your program has a noticeable performance benefit from using SIMD instructions, you can move the relevant functionality into a shared object, and distribute the program with several versions of it, and dlopen() the correct one at runtime. The absence of programs that actually bother doing this, can serve as an indicator as to how big the performance benefit from SIMD optimizations really is.

    Does that explain it better?

    --
    The world will end in 5 minutes. Please log out.
  56. Re:Java is a slow cruncher by Anonymous Coward · · Score: 1, Insightful

    These days, processing cycles cheap, programmer time expensive.

    Are you a project manager or something? He's asking for a 'zillion' machines to run it on, so processing cycles are not quite that cheap it seems.

  57. Re:Java can be faster then C sometimes by sonamchauhan · · Score: 2, Interesting

    Optimising compilers can do much the same thing for C programs. Hotspot JVMs don't have an advantage over all C programs - just mostly those compiled with no optimization. I am not sure though, about the advantages JIT profiling gives to Java programs and whether some C compilers offer the same features to C programs.

    I recall an article by Intel engineers (recent DDJ I think) that described how an executable compiled with their compiler could detect the runtime platform and choose among code-segments optimized for different platforms. These compilers also automatically 'vectorize' non-vector instructions - i.e. they use MMX/SSE/SSE2/3DNow with unrolled loops.

  58. Mod parent informative! by Anonymous Coward · · Score: 0

    By jove, I think he's got it. The "www." addition did indeed work, aye what old chap!

  59. Any math teacher would give you a zero by Professeur+Shadoko · · Score: 1

    Hey, take a 3GHz CPU, 3 billion cycles each second.

    Assuming 1 trillion = 1000 billion (which isn't true in my native language, but I guess in english it is), you need ~300 seconds, i.e 5 minutes for 1 trillion cycles.

  60. Re:Java is a slow cruncher by NoOneInParticular · · Score: 1

    The article might be six years old, but Sun hasn't fixed it in that time. Indeed, one of the guys now works for Sun, but still we will have to wait for java 1.6,7,8,9? to see these problems addressed. No, 1.5 does not address it.

  61. Java? No wonder you need cpu cycles. by leereyno · · Score: 0, Insightful

    Why would anyone want to use Java for something like this? That's like buying a Ferarri and trying to race it after disconnecting half the spark plugs.

    I am not a fan of Java. I don't have any problems with the language itself. What I have a problem with is the fact that it is crippled by the lack of native compilers. And by that I mean comprehensive compilers that work. Something like gcj that won't compile everything that Sun's "compilers" will just doesn't count.

    Interpreting bytecode for the purpose of cross platform capability is all fine and good. There are times when this is very beneficial. But not having the ability to target your programs for a particular platform is insane because it kills any chance at implementing an efficient solution for anything. It is the primary reason why I don't use Java for anything. I'm not going to use a language depends upon a virtual machine that eats 20+ megs of ram just to run hello world...slowly. And that is PER INSTANCE mind you. Shared libraries that eat up tons of ram are one thing, but having multiple programs whose memory footprint is such that they might as well have been statically linked is quite another.

    Then of course there is the speed issue. The lack of native compilers is what doomed IBM and Corel's attempts to create Java-base office suites. They could write the code, but running it was another matter altogether. I suspect that the projects at both companies were thought up by suits who bought into Sun's marketing. No one but a suit would believe that you could create something as complex and resource hungry as an office suite using an interpreted language.

    Java and especially .NET, are examples of what I call Gate's law. Gate's law is the counterpoint to Moore's law. Moore's law states that speed of new computer hardware at a given price point will double every 16 to 24 months. Gate's law states that the efficiency of new computer software will be cut in half every 16 to 24 months. This is why we have to have desktop systems with enough raw power to simulate nuclear explosions just to run Word and Excel at a decent clip. To be sure there is going to be some loss of efficiency due to newer programming strategies that attempt to maximize code maintainability and speed of development, but I seriously doubt that these factors alone are enough to account for the way that most current software packages waste system resources. The only sort of software that still operates at a respectable level of efficiency is computer games. The fact that games are the most perfect example of Gates' law in action would be ironic if it were not for the quantum leaps that have been made in game design over the past quarter century. We've gone from PC-Man to the Lawnmower Man in just under 25 years. Packages like Word should not rightfully require computers with VR-capable speed and memory just to run. Unfortunately they do.

    I'm sure I'm going to get flamed for this post, but then if I cared whether people bitched at me I'd just keep my mouth shut wouldn't I?

    Java advocates are perfect examples of the old adage that if the only tool you have is a hammer then every problem looks like a nail. Java has its uses and its place. The problem is that far too many people want to use it for things that it is not well-suited for. If we can get good optimizing native compilers for the language then most of the problems with Java will disappear and I'll have nothing but good things to say about it. Till then I'll stick to C and C++ thank you very much.

    Lee

    --
    Muslim community leaders warn of backlash from tomorrow morning's terrorist attack.
  62. Re:Wireless or not... by danmitchell · · Score: 1

    On universities, 99% of computers run with nearly zero CPU load for most of the time. Now imagine, we install a "cluster server" on all networked computers.

    Some universities, such as my own University of Texas at Austin, are doing just that.

    --
    The problem with God is that he thinks he's Richard Wagner
  63. The Emporers New Clothes by Anonymous Coward · · Score: 1, Insightful

    Am I the only one to see that the Emporer is wearing no clothes? That's a whole lot of CPU power being used. For what? I pretty simple looking ugly raytraced picture. Aren't there more worthy causes out there to donate our CPU cycles to?

    1. Re:The Emporers New Clothes by eclectro · · Score: 1

      Aren't there more worthy causes out there to donate our CPU cycles to?

      Like hitting reload on slashdot, or browsing your pr0n collection?

      You have to remember when this was first done. The pentium was just being introduced, and people were lucky if they had a 486dx2 at 66 Mhz (running windows 3.1). Linux was still relatively unknown and Mosaic for the internet was just being released.

      By redoing the picture with more people participating, we can get a historical perspective on how much our computing ability has improved. It also improves our knowledge on practical applications of distributed computing.

      I am very interested to see how this picture would turn out. The raytraced picture will be a lot less "ugly" this time around.

      --
      Take the cheese to sickbay, the doctor should see it as soon as possible - B'Elanna Torres, "Learning Curve"
  64. Re:Java can be faster then C sometimes by fredrik70 · · Score: 1

    well, if you don't have the source and the binary you got is for an old 386, then you're stuck. Te cool thing with java is that already bytecode compiled code can be optimised on the fly

    --
    if (!signature) { throw std::runtime_error("No sig!"); }
  65. Re:Java? No wonder you need cpu cycles. by darthCodex · · Score: 4, Informative

    Eh... .NET is natively compiled when it's run for the first time. It also optimizes for the platform (even CPU) it runs on.

    --
    Supplies!
  66. Re:Java is a slow cruncher by 91degrees · · Score: 1

    It's just a number cruncher. There should be no OS specific code in there. Pure mathematical code can usually be ported simply by using a compiler for the OS targetted.

  67. Re:Java can be faster then C sometimes by Arae · · Score: 0, Offtopic

    The parent has no idea what he's talking about, and needs to be modded down.

    The generated code is not what makes Java slow; and given the example from parent's post, a c compiler (e.g. gcc) can also make the same optmization as a Java Virtual Machine and compiler.

    What makes Java slow is the transition from bytecode to machine binary code: it takes time to translate and optimizes codes on the fly. This might be a moot point for some program, but there is also another reason why Java is slower: its garbage collector. Because of it, Java programs are guranteed to run at least 5% slower than C programs.

  68. Re:Java is a slow cruncher by fredrik70 · · Score: 1

    actually, java isn't too bad for number crunching since it involves lots of loops, which gives the JIT a good chance of optimising the code on the fly, things can actually roll on faster than c

    --
    if (!signature) { throw std::runtime_error("No sig!"); }
  69. Re:Java can be faster then C sometimes by Anonymous Coward · · Score: 0

    Ok. My assembly is a little rusty

    Yes, I can definitely see that. You have a point, but you got just about every detail wrong. (80386 is 32-bit, stosw doesn't take parameters, using SSE doesn't yet imply proper vectorization, C wouldn't check for bounds anyway..)

  70. Re:Java can be faster then C sometimes by MemoryDragon · · Score: 1

    Ahem... the compilation to native code is only done once in a optimization process :-) You can notice that java programs become significantly faster within the first 30 seconds after startup...

  71. There are better ways of doing this by sandwichmaker · · Score: 5, Interesting

    Two words: Photon Mapping
    The simulation you are trying to run does not the kind of compute effort that you are planning on using. I implemented a photon map based renderer for a rendering class last year and it can render a room like the one you showed in a couple of minutes.

    The reference you are looking for is:

    Realistic Image Synthesis using Photon Mapping
    By Henrik Wann Jensen

    He is the guy who got the technical oscar this year for being one of the inventors of a method to render materials which display subsurface scattering, e.g. skin and marble.

    1. Re:There are better ways of doing this by Thorgal · · Score: 1

      Not necessarily. Photon mapping would probably introduce subtle differences because of biased/noisy kernel estimates and insufficient number of photons. Even with final gathering (which would make it much slower, also due to two large mirrors in the image), the accuracy (which is all this guy seems to be after) would suffer.

      Not to mention the fact that integrating direct lighting from spherical sources and calculating depth of field with distributed ray tracing aren't fast either.

      --
      "Man in the Moon and other weird things" - wfmh.org.pl/thorgal/Moon/
    2. Re:There are better ways of doing this by Gromer · · Score: 3, Informative
      The photon map algorithm is great for rendering realistic-looking images, but it is definitely not appropriate for a genuine, hard-core simulation like this guy wants to do. The photon map algorithm is based on physics, certainly, but it makes a lot of simplifications in order to make the rendering efficient. For one, it completely ignores diffraction and interference, treating photons as discrete particles travelling in straight lines. If you really want a physically accurate numerical simulation of the way light behaves in a given physical setting, you need to resort to these much more brute-force techniques.

      By the way, I'm going out on a limb here, but I have a feeling that someone who's been published in SIGGRAPH (THE graphics conference) is aware of the state of rendering algorithms in general, and of the existence of photon mapping in particular. Just a guess.

      --
      "Never let your sense of morals prevent you from doing what is right" -Salvor Hardin
    3. Re:There are better ways of doing this by sandwichmaker · · Score: 2, Informative

      The quality of an estimator is not measured using just bias or variance. It is a combination of both, i.e. Root Mean Squared error RMS Error = bias^2 + variance so if you can trade a small amount of bias for a large amount of variance you are doing quite well. Add consistency (i.e. the bias of the estimator goes to zero as the sample size increases) to that and you are golden. This is what lies at the heart of Photon Mapping. The photon map based estimate of the scene radiance is biased but consistent quantity and has a much smaller variance as compared to a pure monte carlo path traced version. As for final gather, you can make yet another bias for variance tradeoff using irradiance caches (greg ward) and irradiance gradients. This can speed up a typical final gather routine by more than an order of magnitude. As for depth of field he will have to simulate a finite aperture in anycase, so I do not see how this is a disadvantage of photon mapping. The direct lighting from spherical sources is not a big deal I do not see what complication you are referring to there. So in summary, the goal of an unbiased simulation is nice, but since what you are really after is an accurate image, for the same amount of computational effort photon mapping will give you better results.

    4. Re:There are better ways of doing this by Thorgal · · Score: 1

      Please note that "this guy" is not simulating wave representation of light to generate his image. Hence, things like diffraction, polarisation and interference won't be there, either.

      --
      "Man in the Moon and other weird things" - wfmh.org.pl/thorgal/Moon/
    5. Re:There are better ways of doing this by Gromer · · Score: 1

      Very true. Thanks for pointing that out. Photon mapping makes a lot of other simplifying assumptions, though, so my larger point remains valid: photon mapping is an algorithm for photorealistic image synthesis, not physical simulation.

      --
      "Never let your sense of morals prevent you from doing what is right" -Salvor Hardin
  72. POV-Ray ... by jkantola · · Score: 1

    Especially with photon calculation speedups among other improvements in the beta release of POV-Ray v3.6, it would be interesting to do a comparison between the two photon models...

  73. For Java haters, here're the benchmarks you need by francium+de+neobie · · Score: 2, Informative

    The Great Win32 Computer Language Shootout

    While Java is not "unacceptably slow" or "1000 times slower" as some claims, it is generally slower than C and much more resource intensive nevertheless.

    Actually if one wants to write this kind of math intensive apps, pure Java is really not the best choice. Even pure C isn't. He should think about implementing some of the highly used routines in assembly (no joke). And since photon tracing can be done parallelly, one would find the SSE and 3DNow! families of instructions useful.

    And finally, besides the CPU, you can also try to do the calculations in your GPU. You'll need a new-fangled PCI-X card in the future to do the calculations efficiently tho.

    Take a look at this site BrookGPU

  74. Re:Java can be faster then C sometimes by j-pimp · · Score: 1

    If your program has a noticeable performance benefit from using SIMD instructions, you can move the relevant functionality into a shared object, and distribute the program with several versions of it, and dlopen() the correct one at runtime.

    I'm running windows so its LoadLibraryEx() you insensitive clod!!. Seriously though, that sounds like a really good idea. I've not done real programming in assembly, if I ever do I'll keep that in mind.
    My defense for programming in windows. Programmers solve problems. Pick something with alot of problems.

    --
    --- Justin Dearing http://www.justaprogrammer.net/ We're just programmers.
  75. he has 12 years experience, he can do it by cheekyboy · · Score: 1

    The dude has >12 years programming experience, he isnt a 12 month jock.

    Surely he should be able to code it in C in his sleep while he is drunk.

    Hell, if you cant debug/code in ASSEM while on LSD, then you are just not good enough.

    --
    Liberty freedom are no1, not dicks in suits.
  76. SPYWARE by Slashdot+Hivemind · · Score: 1

    What proof do we have that this isn't some hideous spyware project?

    1. Re:SPYWARE by mirko · · Score: 1

      The submitter's email address explicitely contains the mention "NOSPAM", so it cannot be ;-)

      --
      Trolling using another account since 2005.
  77. I like the Md5Crk applet model by Gollum · · Score: 4, Interesting

    MD5Crk.com has an applet on their site that does distributed calculations so long as it is visible in the browser (and assuming that you have specifically permitted it to do so). They are trying to find a collision to demonstrate that MD5 is insecure.

    This is great for a simple calculation that returns simple results (e.g.MD5), but probably wouldn't work in a situation where you have to have lots of data to work from. Of course, if you can break it down sufficiently, it might work, and I guess he has already done the work in figuring out how to break it down and recombine the results.

    See MD5Crk for the applet in question.

    1. Re:I like the Md5Crk applet model by Inda · · Score: 1

      I saw this when it was posted on /. way back.

      I could never understand the fact that by the time the VM and the applet had loaded, my PC could have hashed 200 strings using plain Javascript.

      Seems silly to me.

      --
      This post contains benzene, nitrosamines, formaldehyde and hydrogen cyanide.
  78. Sparcstation 1 by thskyt · · Score: 1

    Hmmm ... thinking about it, I might grab my old Sparcstation IPX, get it operational once more and have it spare some cycles while doing ... nothing ... :) To hell with ecology, I'll turn of a streetlamp on my way to work, that ought to level the waste of energy out.

  79. Re:Java can be faster then C sometimes by francium+de+neobie · · Score: 1

    Actually gcc would never generate shits like "pop AX" twice for a 32-bit number, as long as you're running it on at least a 386 and a 32-bit OS.

    Saying C sucks just because some damned old compiler and OS don't use the 32-bit registers is nuts. It is mostly a mistake of the user, it has nothing to do with the language.

  80. Er... Why? by AndyRobinson · · Score: 1

    I'm not trying to be a pain in the ass or knocking what you're trying to do, but I don't get the point of the experiment. I'm sure that there is one, and I'm too dumb to work it out, so could someone explain it to me? I can see the point in protein folding, SETI etc but I can't figure out what the end result of this is. If someone could explain it to me, I might donate some CPU time...

  81. Wasted opportunity by Sanity · · Score: 1
    If he had taken some time to automate this process - he could probably have achieved what he wanted to do in an hour, rather than a month.

    Rather than have people email him to get the code, why not just allow them to download it themselves? Rather than require that people email him their cache directories at the end of it, why can't they be uploaded automatically?

    What a shame.

    1. Re:Wasted opportunity by BenjyD · · Score: 1

      He wrote the thing in Java - he's obviously not big on efficiency. Given that SSE/MMX optimised code can be up to six or seven times faster than the equivalent C implementation (on x86 machines only, of course), and C is about twice the speed of Java for a lot of FP maths intensive stuff, he's already an order of magnitude behind.

    2. Re:Wasted opportunity by Anonymous Coward · · Score: 1

      Given that SSE/MMX optimised code can be up to six or seven times faster than the equivalent C implementation

      Modern JVMs optimise for SSE/MMX. Your point again?

      he's already an order of magnitude behind.

      No, actually, he has already written and started to run the thing. I have yet to see any of the people here bitching about how he should be optimising for all different operating systems and processors in C, actually sitting down and writing anything comparable. So he is an infinite number of magnitudes ahead of you.

    3. Re:Wasted opportunity by Sanity · · Score: 1
      He wrote the thing in Java - he's obviously not big on efficiency
      I will let others respond to your anti-Java flamebait, but what I was referring to is the ease-of-use of his code, not its cpu-efficiency.
    4. Re:Wasted opportunity by BenjyD · · Score: 1

      I was going by the benchmarks here that someone else linked to. These show Java at around three to ten times slower than C++, using JRE 1.4.1.

      Modern JVMs optimise for SSE/MMX. Your point again?

      And it probably does about as much as GCC's use of MMX/SSE - not much. You generally have to write the inner loop with the opcodes available in mind to get the most performance.

      I have yet to see any of the people here bitching about how he should be optimising for all different operating systems and processors in C

      What a pointless comment. The guy wants community participation to run his program. There's little point in him saying "Look at all the processor power this required" if the only reason it took that much is because he wrote the thing in a slow language.

    5. Re:Wasted opportunity by Anonymous Coward · · Score: 0

      I was going by the benchmarks here that someone else linked to. These show Java at around three to ten times slower than C++, using JRE 1.4.1.

      You dont answer parent. Those benchmark are for some other functionality. You dont have an equivalent implementation in C/C++ that shows a difference on the same functionality. And read
      this post below.

    6. Re:Wasted opportunity by rkeene517 · · Score: 1

      This is one of the few sensible responses. You are exactly correct. The email was a bad idea. I will be posting it on my web site soon. I may try to automate the upload. The problem is that the result data set is 20Meg and i am worried about the upload time on a 56k modem. I may put an 'upload' button so it happens when the user decides it should.

      --
      Inside every complex program is a simple solution trying to get out.
  82. WinOSI by imsabbel · · Score: 1

    winosi (winosi.onlinehome.de)
    does all the submitters program does and more.
    Its a "raytracer that works by shooting photons from lightsources and looking where they hit the scene. Its slow, but accurate and allows the mergins of multiple runs from different computers, too.

    --
    HI O WISE PRINCE. WHT TOOK U SO DAM LONG?
  83. Java has come a long way since 1998 by Avt232 · · Score: 5, Informative

    As founder of the Distributed Hardware Evolution Project which is written in Java, I'd like to remind you all that the Just-In-Time compiler coupled with the real time profiling and dynamic on-the-fly optimisation that goes on in the Server VM makes the difference between C and Java minimal for code which is in the critical region. This is specially the case for code which is executed over and over again, such as with these distributed processing projects. In fact the guys at Sun are doing such a good job at exploiting the ever more complex characteristics of different processors that Java code is expected to run faster than C in the future. Also, during the weeks that you would spend debugging and porting your C code, your Java code has gone miles ahead doing useful stuff! If you would like to start your own Java distributed processing project, DistrIT might help.

    1. Re:Java has come a long way since 1998 by Anonymous Coward · · Score: 0

      I'm inclined to think that Java is not quite as slow as some would have us believe. Regardless, I still think it's probably slower than some people need. But when someone like id Software moves from (now I believe) C++ to Java, I'll start to take it more seriously for computation intensive applications.

    2. Re:Java has come a long way since 1998 by Anonymous Coward · · Score: 0

      But when someone like id Software moves from (now I believe) C++ to Java, I'll start to take it more seriously for computation intensive applications.

      You'll be waiting a long time. Even for something trivial like calculating the colinearity of a group of points languages like C and C++ on a modern optimized compiler will outperform the equivalent code running on a JIT JVM (or gcj compiled exe) by a least an order of magnitude.

      Java is useful for many things. High performance calculations isn't one of them.

  84. Re:Java can be faster then C sometimes by Arae · · Score: 1

    Yes, that's why I said that's a moot point for some programs (mainly the ones that has only a small chunk of codes, while processing a large chunk of data).

  85. I need cycles, too! for spin glasses... by dummkopf · · Score: 3, Informative

    1 Month on 100 sparcs? Peanuts! In my research simulations usually take (depending on the problem) up to 6 months on an average of 150 workstations (and some runs on large clusters). You wonder what I do? Spin glasses!

    Spin glasses are systems in with the interactions between magnetic moments are in conflict with each other. These competing interactions make these systems extremely hard to simulate at low enough temperatures. If you have a linux box sitting around idle which is fast enough, let me know and I will provide you with some samples to run. Current project: 100 - 300 samples, each takes ~ 10 days on a 2.4 GHz Xeon... For information on how to contact me, go to duamutef.ethz.ch. Of course your name will be mentioned if you compute a considerable number of samples!

    1. Re:I need cycles, too! for spin glasses... by grommit · · Score: 1

      Back in 1994 when he originally did this project, I don't think there were any 2.4 GHz Xeon processors around. In fact, I'm pretty darned sure of that.

      Perhaps if you could tell us what kind of processing power you consumed for your research back in 1994 we'd be able to better compare which project is "peanuts" or not.

    2. Re:I need cycles, too! for spin glasses... by dummkopf · · Score: 1

      well, the math is not too hard: if we assume a (rather conservative) linear scaling of processor power, then back in 1994 I had a P133 MHz. For the sake of simplicity, let's assume that is was 240 MHz. In other words 10 times slower. This means that you should multiply my CPU time by a factor 10 - 13 and then compare the numbers... A sparc1 has (as far as I recall -- I could be off) 25MHz. This means that his work, on a 2.4 GHz machine would take about 100 times less time. Doing a rather rough estimate and rescaling his work to today standards this means that he could run one 2.4GHz Xeon CPU for one month and get the same data. In my case, I run 150 CPUs for 6 months... insightful, huh?

  86. A qualified "yes" by Niet3sche · · Score: 1
    This brings up a very interesting point: is there, or should there be, a tie-in with social networking or another such electronic meeting media, a "spare CPU cycle" trading board, such that if I wanted to use X cycles from a machine, if/when they wrote some code, then they would get X cycles "credit" on my machine, with the option for me to allow more as I desire?

    If not, I am proposing this methodology here right now (*cough prior art cough* - see, academia has ruined me forever now!). The crux of the matter, then, seems to be this: if there is not such a system, would you guys use/desire one? I know that I would, especially as I'm looking at doing some distributed programming myself here in the vaguely-distant future (read: when I get around to it *wink*).

    1. Re:A qualified "yes" by Avt232 · · Score: 2, Informative

      Hiya, this would be great. I'm currently about to extend DistrIT to make a system so that researchers can book CPU time from all the unused cycles of my Department's PCs. It could also be extended quite easily to do what you're saying, and have a central server where you get credits for donating your CPU cycles and then you can upload your processing task and get other people in the pool to run it.

    2. Re:A qualified "yes" by Niet3sche · · Score: 1
      REALLY? That's a *very* cool idea. :)

      Awesome, I'm glad to hear that it's actually out there. I see it's in Java; I find Java has the advantage over C with UNIX libs by providing a far easier interface with/to socket ops.

      Sorry, I *do* have both of Stevens' books, but it's a lot easier to make calls as opposed to re-inventing the wheel (again, via raw calls in C - I know it may well be apples and oranges here). I won't argue that it's better, mind you, but also I'm not about to say that I can do a better job at rolling my own than professional computer scientists - I can't.

      Into the bookmarks it goes - thanks again! :)

  87. Does nobody program in Assembly anymore? by Polkyb · · Score: 1

    If you want the maximum speed out of processor, surely assembly would blow the socks of ANY other language...

    $0.02

    --
    I've never shoed a horse, but I once told a donkey to piss off!
    1. Re:Does nobody program in Assembly anymore? by arkanes · · Score: 1
      In rare cases, yes, but in general no. Certainly not with large scale programs - the kind of analysis a compiler can do on a modern machine with memory and cycles to burn on it rivals anything a human programmer could do. In certain cases you can know more about the compiler is doing and therefore write better code than it can (this one reason JIT compilers can (rarely) outperform traditional compiilers, afterall), but the general statement "assembler is faster" is untrue.

      In fact, as a previous poster said, there's no real point in evaluating the "speed" of a language - it's the runtime and compilation that determine the speed, not the language it was written in - C code running under CINT is going to be slower than "native" code, obviously. The question is whether or not a human is a better compiler than a compiler and the answer is "only sometimes".

  88. Re:Wireless or not... by Anonymous Coward · · Score: 0

    This idea was floated at my university (Uni of Queensland, Brisbane, Australia). With a very large number late model user lab PCs available, and many simply idling (no user at all, only a screensaver).
    The idea was shot down by the Physics department when they calculated the added cost of electricity and air conditioning.

  89. Re:Java is a slow cruncher by jabbadabbadoo · · Score: 3, Insightful
    "...things can actually roll on faster than c"

    And pigs _can_ fly.

    Here's the deal: when you perform fp ops in Java, operands go where? The _Java_ stack which actually resides on the heap. In C? Usually registers. The JIT register allocation algorithm cannot possibly optimize like a good C compiler can because of the purely stack-based architecture. What's worse - after each fp op, the CPU must fetch byte codes from the class pool which also resides on the heap. So farewell L1 cache line optimization (and sometimes L2 caching)

    Note that most benchmarks are too limited, the Lx cache line problems appear in non-trivial applications with a bit more more than a loop doing fp addition.

  90. Condor by elvum · · Score: 1

    Have a look at the Condor Project - I think they're already on it :-)

  91. Re:Java is a slow cruncher by jabbadabbadoo · · Score: 1
    It doesn't matter if the article is six years old. The problem with Java is still present: it is stack based, which makes any optimizations hard. It still fetches bytes code from the class pool which is on the heap, and operands from the Java stack which is on the heap. This means L1 and L2 cache misses all the time. In C, most operands are on the stack if the compiler has a sane register coloring implementation. Also, the stack ops are faster than heap mem-fetch.

    In any non-trivial app, C is MUCH faster in this respect.

    Not trying to debunk Java here - just pointing out that Java is a silly choice for number crunching apps.

  92. Published in Special Interest Group in Usernames by bm_luethke · · Score: 2, Funny

    "Of course, you will get mention in the article if it gets published."

    10 pages of article, 300 pages of contributors listed as e-mail addresses and slasdhot ID's :)

    I rather suspect that none of the smaller contributors will get mentioned in the article (probably the largest installations will). I would guess that a link with contributors will be given.

    --
    ------- Sorry about the spelling, I suffer from two problems. Dyslexia makes it difficult to spell well, lazy makes it
  93. Re:Java? No wonder you need cpu cycles. by Anonymous Coward · · Score: 2, Informative

    You really should catch up on current technology. Java is only interpreted at program startup. It is compiled down to native code just like C++ is, except the compilation happens at runtime when there is more information available (e.g. which method calls are really virtual and which are not). So, yes, the first couple of seconds of your program are interpreted but the rest of the time the speed will be just as fast as C++, sometimes faster.

  94. Re:Java is a slow cruncher by Anonymous Coward · · Score: 0

    true, especially cache misses makes java hog

  95. C++ using SSE by schouwl · · Score: 1

    Move it SSE awair code and I will eb glad to join.

    1. Re:C++ using SSE by Anonymous Coward · · Score: 0

      in the latest JVM from SUN, java -server adds SSE automatically for you.

  96. I'm into remote viewing... by Anonymous Coward · · Score: 1, Funny

    ...so I can detect photons that arn't here.

    1. Re:I'm into remote viewing... by Paradise+Pete · · Score: 1
      I'm into remote viewing...so I can detect photons that arn't here.

      Maybe you can tell me where mine is, then. I've looking in the usual places; the cushions of the couch, next to the refrigerator, etc. Anyway, let me know. Thanks.

    2. Re:I'm into remote viewing... by Anonymous Coward · · Score: 0

      Those are called "hallucinations". Now get back to your padded cell.

  97. Re:Java is a slow cruncher by Chris_Jefferson · · Score: 1

    You say no OS-specific code, but note that C/C++ don't understand things like directories in their default setup.

    So for a start you need linux/windows

    With this kind of application endian could be important, so you have linux/windows/mac os x.

    Then of course he might have to compile it against multiple libcs under linux.

    And you are going to want different versions optimised for the various different processors.

    I'm up to at least 10 or so versions here and I'm not even really trying

    Oh yes, *BSD users might want a version to, theres another 3 or so.

    Or one java version

    --
    Combination - fun iPhone puzzling
  98. Use real photons by Andy_R · · Score: 5, Funny

    You could cut your rendering time down to about 1/200th sec by employing the following hardware:

    old cookie tin
    2 marbles
    cheap disposable camera and a... ...whatever that blurry thing top right is supposed to be.

    The resultant time saving could be usefully employed learing how the gif file format works.

    --
    A pizza of radius z and thickness a has a volume of pi z z a
    1. Re:Use real photons by Anonymous Coward · · Score: 0

      "Want to Make $$$$ with your Computer? No Risk! Simply press shift-4 four times in a row"

      Hmmm, that doesn't work! All I get is '''' ?

  99. Re:For Java haters, here're the benchmarks you nee by Anonymous Coward · · Score: 0

    Interesting, the C++ results are run with full optimization on, while Java is run without optimization turned on. I'm not saying the results are purposely biased, but you have to know what you're doing when benchmarking.

  100. Re:Java can be faster then C sometimes by orthogonal · · Score: 4, Insightful

    Either I'm suffering deja vu, or this has been posted nearly verbatim before in a previous discussion of Java vs. C.

    Not only that, Face the Facts (770331)'s last three or four posts are word-for-word copies of other people's posts, copied from anti-slash.org's "database tool".

    Note only that, but anti-slash.org has posted links to his posts, asking their members to mod him up, with the notation "another karma whore account" -- which implies he's karma whoring in order to get mod points in order to troll.

    (Implies but doesn't prove: anti-slash.org at one point asked its members to mod one of my posts up, why I'm not sure.)

    But whatever Face the Facts (770331)'s motivations, his posts are plagiarism and he's a plagiarist, apparently not talented enough to write his own posts.

    Mod him down.

  101. Re:Java can be faster then C sometimes by w4rl5ck · · Score: 1

    if I interpret my 80386/80486 "handbook for programmers" - Microsoft Press *eg* - correctly, the x386 family already had a stosd to store dwords. And that mighty processor introduced eax/ebx/ecx/edx, so why should the C compiler use 16 bit registers?

    Then, the 4 statements would be running in pipes on anything >x486. Of course you'll get a block because ax is used in both statements, but it should be possible to run the second pop while the stosw is executed. Don't remember the names for the pipe states right now, so I can't explain better.

    Additionally, if one distributes source code, the compiler could produce highly optimized code that would outrun java on *any* machine, but I think someone else mentioned this.

    I have been hardcore-coding assembler back in 1995 for about 6 month (more than 10.000 lines. well I think the code was not *good* or anything, but I did... :) and if I know one thing for sure it is: respect the way the hardware works, and you'll get the fastest program that's possible. In this case, it was a multitasking OS kernel that booted from BIOS to command line in less than 2 secons on a 133MHz P1 - pretty much the same as BeOS... :)

    Anything that moves you away from hardware access makes it slower, because it's adding overhead that could have been avoided using the mighty brain of (wo)men.

    Right now, the compiler optimisations are so good that it's nearly no need anymore to write assembler code to get speed improvements. But the Java VM is still not the same as native compiled C. I like Java for some things, but number crunching is not one of them.

  102. Re:Java can be faster then C sometimes by Viol8 · · Score: 1

    " I think has trouble with some things like the Linux kernel."

    Thats probably because some kernel code uses C++ type syntax, its not pure C. Function pointer calls spring to mind plus the gcc specific
    (or is it c99 syntax?) method of defining structure values. eg:

    struct fred f {
    .a = 1
    .b = "hello"

    etc

  103. Re:Wireless or not... by orthogonal · · Score: 3, Informative

    The parent post is stolen, word-for-word from this post by SharpFang (651121).

    It was stolen via the anti-slash.org database

    Mod parent down.

  104. isn't this duplicate work by cornjones · · Score: 2, Interesting

    If you parcel the same zip out to everybody and they start crunching it, won't everybody be working on teh same part of the picture? Even w/ a pseudo random start point how are you guaranteeing all the nodes are working on all the pieces. I assume you have thought of this. The post seems to say that the more people you get, the more resolution you will have at the end. How are you doing this? How are you piecing together all the crunched numbers?

    1. Re:isn't this duplicate work by elvum · · Score: 3, Informative

      Everyone works on the whole picture at once, but simulates different randomly-emitted photons. All you need is a different random seed for each client, which is trivial to manage.

    2. Re:isn't this duplicate work by Anonymous Coward · · Score: 0

      Yeah, just like SETI!

    3. Re:isn't this duplicate work by cornjones · · Score: 1

      you're an idiot. SETI parcels out a different package to each user. This guy didn't seem to be doing that, hence the question.

    4. Re:isn't this duplicate work by Anonymous Coward · · Score: 0

      Heya fucktard, time for a history lesson: When SETI first started out, they accidentally or otherwise sent the same three data packets to everyone. This lasted several weeks before someone noticed the data coming in and going out was the same.

      Keep your idiot label. You obviously need it more than I do.

  105. A zillion, huh? by slowtech · · Score: 0

    "The plan is to run the program on a zillion machines for a month and combine the results."

    Really? Have you done the math on that? Are you sure that only a zillion machines can do the work in a month? You might need a few more, I mean, a zillion seems like enough, on the face of it, but you might need a few kajillion more just to make sure ...

    On the other hand, it should be easy to get a zillion volunteers. More than that might be a problem, though.

    --
    "Well it's not Victory - but then it's not Death either."
    1. Re:A zillion, huh? by Anonymous Coward · · Score: 0

      I think what he really needs is a bajillion....it's the only way to be sure.

  106. Re:Java can be faster then C sometimes by Alsee · · Score: 1

    The issue is that to do that you'd need to give everyone source and they's all have to compile it themselves. You're not going to get many people to do that.

    You really need a simple download-and-run file. If you compile some C you need to compile it to the lowest common denominator or it's going to choke on some systems.

    -

    --
    - - You can't take something off the Internet! That's like trying to take pee out of a swimming pool.
  107. Re:Java can be faster then C sometimes by shfted! · · Score: 1, Funny

    They did that with me too. I look at anti-slash with a guarded eye.

    --
    He who laughs last is stuck in a time dilation bubble.
  108. Re:Published in Special Interest Group in Username by Anonymous Coward · · Score: 0

    ... 300 pages of contributors listed as e-mail addresses ...

    that can be bought separatedly on a CD in a .TXT format, and costs only $.02 per unique email address.

  109. Re:Java? No wonder you need cpu cycles. by sploxx · · Score: 1

    One thing I never understood about java is how it got known to most people as more powerful, expressive and 'modern' than C++.

    This is simply not true. Java is still more or less a subset of C++. Good for the people who are ok with that, but I really do not need a language which forces it's views onto me.

    So I'd like to have a bytecode backend (e.g. JVM) and a class library for C++. I think most of the dispute over Java/C++ would end because everyone can write in his/her preferred language and run the code on the same meta-platorm.

    Although RMS argues against it (with fears I do not understand), it would be nice to have a JVM backend for GCC. One would have C,C++,Java, Scheme (via bigloo!), Obj.-C, even Fortran as a compile-once-run-everywhere language, hopefully in a way compatible with java .class files.

    Yes, I know that there is mips2java, but excuse me if I call it a temporary kludge :) (It's still nice work, but is not the straight-forward way to do it)

  110. Photon Simulation vs Raytracing by PhunkySchtuff · · Score: 3, Insightful

    I've looked on the dude's web page, but there's nothing there that tells us what this is about.
    In what major way is photon simulation different from ray tracing?

    1. Re:Photon Simulation vs Raytracing by Anonymous Coward · · Score: 5, Informative

      Photon Simulation: "forward ray tracing". Emit photons from light sources, have them bounce off scenery, and see where they hit the eye.

      Ray tracing: "reverse ray tracing". Emit "sight rays" from the eye, have them bounce off scenery, and see where they hit light sources.

      That's simplifying, of course.

      Forward ray tracing was here first, but was quickly (all but) abandoned, since it is computationally way more intense (why, 10 years ago, it would have taken 100 Sparc Station 1's an entire month just to calculate one small image!). Imagine simulating a zillion photons just to discover that over 0.99 zillion had failed to reach the eye...

      On the other hand, it is physically more correct, since effects like caustics are very difficult to do right in "reverse" ray tracing.

    2. Re:Photon Simulation vs Raytracing by gr8_phk · · Score: 2, Informative

      A reasonable explanation. There is a new technique called photon mapping too. Photons are emitted from the light sources much like this guy is doing. However, each time a photon hits a surface, the impact is stored in a big data structure - the photon may then be reflected depending on surface properties. This "photon map" is view independant. Rendering an image then consists of doing ray tracing from the eye into the scene, but to calculate surface illumination where the ray hits a surface, you use the photon map. This avoids throwing away the 99.9% of photons that don't strike the eye. It can be made physically correct as well. BTW to see how fast regular ray tracing has become check out rtChess .

  111. You're shitting me? by Anonymous Coward · · Score: 0

    It took you a month to learn to use lens flare filters?

  112. Conspiracy theory by Andreas(R) · · Score: 1
    I used a few million CPU cycles to extrapolate the image, the result is here.


    Now, where's my publication in SIGGRAPH 04?

    -Bow for the Gimp!

    1. Re:Conspiracy theory by Juiblex · · Score: 0

      Hehehehehehe

  113. Re:Published in Special Interest Group in Username by Avt232 · · Score: 1

    I am actually about to publish a paper with the aliases and team names of the 20 top contributors of the Distributed Hardware Evolution Project. The names of the circuits in the figures were also chosen by contributors. If anyone is interested in having their own island in an island based coevolutionary genetic algorithm evolving the next generation of safe hardware circuits across the internet, join DHEP! You will be contributing cutting edge research.

  114. Re:Wireless or not... by ashot · · Score: 1

    HA! ok there goes my idea.. =P

    --
    -ashot
  115. Re:Java? No wonder you need cpu cycles. by Anonymous Coward · · Score: 0

    Compare:

    Java is still more or less a subset of C++.

    and:

    I'd like to have a bytecode backend (e.g. JVM) and a class library for C++

    You are contradicting yourself.

  116. OT, but... by evanbd · · Score: 0
    speaking of MD5... I have a couple files that collide in the least significant 76 bits of the hash. It's from a test run of a program that is basically the same as the md5crk.com people's project, but intended to find smaller collisions. It's an entirely academic endeavor, for my computer security class.

    a
    b

  117. Re:Java can be faster then C sometimes by mrrazz · · Score: 0

    Function pointer calls and designated initializers are both defined in the c99 standard.
    But the kernel does indeed heavily depend on some gcc extensions.

  118. Why Timothy? by Anonymous Coward · · Score: 0
    I worked with photon tracing about 10 years ago. Why are you using brute force techniques? I guess you are because you have a very noisy image after 29 billion photons. Why not use bi-directional path tracing?



    Just wondering

  119. Re:Wireless or not... by Avt232 · · Score: 1

    I'm currently about to extend DistrIT to make a system so that researchers can book CPU time from all the unused cycles of my Department's PCs. Using Java would make it secure and transparent for windows and linux users..

  120. Re:For Java haters, here're the benchmarks you nee by Nivag353 · · Score: 1

    Hmm... not every machine is an Intel box running a Microsoft O/S

    Using Java has advantages:
    (1) Can run on multiple O/S's including Linux
    (2) Can run on alpha and other non-Intel hardware
    (3) Has well defined mathematical results regardless of O/S and hardware
    (4) Java Applets are sandboxed by default, thus giving more peace of mind than using other languages

    Also, with the standard JIT compilers, performance is similar to C; sometimes faster, but mostly a little slower.

    For numerically intensive Java applications I use the -server optimisation flag. I gained about a 10% performance improvement over the -client (default) optimisation.

    -Nivag

  121. Re:Java can be faster then C sometimes by zelphior · · Score: 1

    If you are still running a compiler from an old 386, then maybe it's time to upgrade. there are plenty of much, much newer compilers which are free to download. just try googling for a few minutes and you should find quite a few.

    --
    If you can read this then I forgot to check "Post Anonymously"
  122. Re:Java? No wonder you need cpu cycles. by sploxx · · Score: 1

    No, I'm not.
    I am talking about the language Java and the language C++. C++ as a language is a superset of Java as a language.

    The java class library is indeed more comprehensive than the C++ 'counterpart', the STL, but there are of course lots of additional libraries for C++.

    I was talking of linking this hypothetical C++ bytecode to the java class library or a similar C++ library.

  123. Re:Java? No wonder you need cpu cycles. by Anonymous Coward · · Score: 0

    > I'm sure I'm going to get flamed for this post
    This in fact should get modded flaimbait or troll.


    It's no use, fellow AC, spare your fingers. You can lead a rightwinger to the facts, but you can't make him read or think.

  124. Weapon research? by Anonymous Coward · · Score: 0

    Who tells me that you won't do research for nucular Weapons?
    Maybe Laser-Gun?

  125. I remember that experiment by Wansu · · Score: 1



    Yeah. The sysadmin where I worked had set up a bunch of the workstations to run that stuff. Trouble is, the nightly builds were falling over. People were pissed.

    --
    Wansu, th' chinese sailor
  126. Re:Java? Fortran? by tap · · Score: 1

    No reason you can't call fortran routines from LAPACK or whatnot from a C program.

    Fortran was the first high level programming language. It was created to write scientific programs in. Hence, the some of the oldest programs around are scientific programs written in fortran. That's why scientific code has this huge legacy of fortran, that you don't see elsewhere.

  127. Java is getting better at GUIs by MemoryDragon · · Score: 1

    You said two years ago, that was before 1.4.
    Java, well Swing is getting better.
    There were two factors you encountered back then.
    Swing back then was less optimized than it is today, and back then Swing didnt revert to the underlying hardware acceleration but the the Windows native toolkits already did.

    The situation currently is more or less, that the speed difference in Swing compared to native toolkits is neglectable and in some cases even better.
    The reason for this is, that Swing now reverts to hardware acceleration for its 2d drawing functions and the library is better optimized.

    The current situation is following:
    Windows JDK 1.4: Speed difference neglegtable and acceptable
    Windows JDK 1.5: Speed difference barely visible at all

    Linux: JDK 1.4 Sun: Swing is still much slower than every other toolkit but has acceptable speed
    Linux Sun JDK 1.5: Swing is faster but still slower than GTK2 (havent tried the OpenGL option yet)
    Linux Blackdown 1.4.2RC1: Swing is faster than GTK2 and a tad slower than Qt
    Mac: no noticable speed difference since 1.4, in fact with a little bit of tweaking you dont notice any difference to nativ apps at all due to the excellent L&F Apple provides.

    So the situation is not that bad as everbody shouts. The funny thing is most people who scream Java is slow, Java guis are slow neither have seen the SWT in action nor have probably seen a post JDK 1.3 JDK, their knowledge basically is outdated by more than two years.

    Over here we slowly are moving away from web based guis, due to the imminent fork of Microsoft with HTML which currently is in the beginning stages and will be completed with Longhorn.
    Swing has become fast enough and is very flexible.

    1. Re:Java is getting better at GUIs by Anonymous Coward · · Score: 0

      or you can use SWT and get fast speeds now.

    2. Re:Java is getting better at GUIs by MemoryDragon · · Score: 1

      That depends on the situation, over here the SWT is significantly slower than any Swing app. But that speed difference can be attributed to the slowlyness of GTK2 compared the the Blackdown 1.4.2 Swing implementation. The swt itself performs more or less as fast as the underlying gui toolkit does since it only is a meta layer over existing toolkits. On windows Swing and SWT performe slightly the same, with the SWT being better integrated but Swing being more flexible with its pluggable look and feel system. And on the mac I think it makes no difference, since Swing on the Mac is fast and tightly integrated into Aqua.

  128. Urgh! by Xophmeister · · Score: 1

    Mmmm... 8-bit photon mapping! How about some true colour!?

    +n Flamebait, for suitably large $n\in\mathbb{N}$

    --

    Christopher Harrison

  129. Re:Java? No wonder you need cpu cycles. by Rich0 · · Score: 1

    If the class library for C is written such that it never requires the use of a pointer I'd be all for it.

    Half the value of Java is that the entire language is implemented in a non-pointer-dependant manner. Where do you think all the buffer-overflows come from?

    Pointers should be a feature reserved for bleeding-edge optimization and low-level operations. They should not be required to do so much as use the scanf function. Sure, they're a fundamental function of how computers actually work at the machine code level, but they're probably the most frequent source of bugs.

    Java did well not to implement them...

  130. Hmm Java... by crusty_architect · · Score: 1, Funny

    To a man with a hammer, everything looks like a nail.

  131. A: 1 Re:Photons by feelyoda · · Score: 2, Interesting

    The dark adapted eye can detect a single photon. This is the only known direct macro observation in biology of a quantum mechanical event.

    --

    Robo-Blogs of the world: UNITE!
  132. Re:Java can be faster then C sometimes by Anonymous Coward · · Score: 0

    ""handbook for programmers" - Microsoft Press *eg* - correctly"

    Why did you put *eg* in there? eg means "for example", I don't get it.

  133. Email swampage by cyberfunk2 · · Score: 0

    How smart is it to give out your email on ./ ? His email server is likely 'Illuminated' by it's own flame. You'd think he would have thought of a better ditribution process.

    1. Re:Email swampage by Lionfire · · Score: 0

      Not as smart as spam-proofing your email address in the article, and then letting the slashdot editors start off with an un-spam-proofed version :)

    2. Re:Email swampage by rkeene517 · · Score: 1

      Im learning my lesson the hard way on this one. I should have (and will) posted the cpjava.net site and then let everyone download from that. Apparently posting my email was not a good idea. The response has been way more than I expected.

      --
      Inside every complex program is a simple solution trying to get out.
  134. What about setiathome and BOINC? by cpghost · · Score: 1

    Hmm... not every machine is an Intel box running a Microsoft O/S

    True, but that's not a reason to use pure java. Compare with setiathome, which is available in binary for a lot of processors and operating systems.

    There's also the new BOINC architecture...

    --
    cpghost at Cordula's Web.
    1. Re:What about setiathome and BOINC? by mabinogi · · Score: 1

      But seti@home is more than just one guy.

      It takes a lot more time to provide binaries for multiple platforms - not to mention often needing access to those platforms, or a whole heap of cross compilers.
      And then there's dealing with portability issues.....

      In the end you spend 10% of your time writing the code, and 90% trying to distribute it.

      Or you could just give out a .jar file.

      --
      Advanced users are users too!
  135. Command Line by coldtone · · Score: 1

    I would love to help, but my linux box does not have an x server, so I would not be able to run a java app with any kind of gui.

    Is there a non gui option? Something I can run from the command line?

  136. Who will own the image? by KernelHappy · · Score: 1

    The submitter mentions "you will get a mention in the article if it gets published" but never states who will own the image after it's complete. In this day of intellectual property pissing contests I think it's rather interesting and important to address.

    Personally if I contributed to the project I'd like a copy of the image myself. This could actually be a model for collaborative work, give me your cycles and I'll give you a copy of what we create together.

    --
    -- Button up, your ignorance is showing
  137. Re:Java is a slow cruncher by Lumpy · · Score: 0, Troll

    These days, processing cycles cheap, programmer time expensive.

    Thank you! you exposed the SINGLE reason that software completely sucks today.

    This mentality is why games are bloatware, Office suites suck, Operating systems use 2X the resources than the last iteration... (linux kernel excluded as I can remove crud, and linus and the crew are always optimizing that bugger)

    Until someone starts smacking people hard who say that the state of general computing will continue to spiral into the toilet.

    Gnome 1.X would run fine on a Pentium 233 with 64 meg of ram... today, gnome, KDE and everything else linux is requireing way too much memory and processor to do the same job. and Windows is 2X worse... (Xp is NO DIFFERENT than W2K other than silly eye candy.. yet it is massively slower than 2K...)

    Luckily there are exceptions.. the Blender programmers are making things faster and smaller, Mozilla are also striving to that end....

    --
    Do not look at laser with remaining good eye.
  138. Re:Java? No wonder you need cpu cycles. by sploxx · · Score: 1

    You're talking about C. I was talking about C++.
    The only thing C++ has in common with C is that the C++ language contains the C language as a subset.

    In C++, you have pointers, but you can live well without pointers, for example by using the STL (standard template library). You can wrap pointers in 'safe-pointers'. You have the power to use pointers, but you can hide them and program in a very Java-like way.

    If you compare C with Java, I agree completely. But I suggest that you take a deeper look at C++, you'll find that you can easily move to C++ without being restricted by anything - and you can take advantage of the low-level possibilities (pointers and such) of C/C++, if you ever need to do.

  139. Re:Java is a slow cruncher by 91degrees · · Score: 1

    You say no OS-specific code, but note that C/C++ don't understand things like directories in their default setup.

    They just need files.

    With this kind of application endian could be important, so you have linux/windows/mac os x.

    This is easy enough to deal with in a macro.

    Then of course he might have to compile it against multiple libcs under linux.

    Distribute it as source. Use static linking for the binary distribution.

    And you are going to want different versions optimised for the various different processors.

    The C compiler can do that perfectly adequately. How many optimisations are there that slow down another machine noticeably? Even if they could, the architecture specific optimisations in Java aren't going to give anything like the same optimisation.

    I'm up to at least 10 or so versions here and I'm not even really trying

    I make it 3. Linux, Windows, Apple.

    Oh yes, *BSD users might want a version to, theres another 3 or so.

    I thought BSD could run ELFs.

  140. Re:Java? No wonder you need cpu cycles. by fishnuts · · Score: 2

    hmmm. like perl!

  141. Re:Java is a slow cruncher by goatan · · Score: 1
    (Xp is NO DIFFERENT than W2K other than silly eye candy.. yet it is massively slower than 2K...)

    The eye candy is one of the resons for XP asthmatic performance

    --
    Saying Apple is better than MS is like saying Botulism is better than rabies.

  142. Why? by danila · · Score: 1

    It seems that the discussion degenerated to bashing Java for being slow, arguing that it isn't and speculating about doing the same in some other bizarre programming language. But I would like to ask a very simply, yet, profound question. Why? What exactly the point of this project? It's not that I am against distributed computing, Java or rendering of strange bubbles. I just honestly don't understand (from reading the writeup and meditating over the 11-year old gif) what rkeene517 is trying to achieve.

    The picture he rendered 11 years ago could now be rendered in about a millisecond on top of the line Radeon. Does he want to up the resulution? Does he want to better simulate the physics of light? Does he want to simply increase the number of photons a thousandfold and see what comes out of it? Does he want to test the limits of Java programming or distributed computing? The inquiring minds want to know.

    --
    Future Wiki -- If you don't think about the future, you cannot have one.
  143. Re:Java can be faster then C sometimes by gralem · · Score: 1

    I believe you are mistaken. In no online forum have I ever seen a comparison to the performance of Java vs. C. You must be thinking of a different type of deja vu, called deja view, which has (obviously) much lower performance.

    ---gralem

  144. Re:Java? No wonder you need cpu cycles. by LiENUS · · Score: 1

    except easier to reverse engineer

  145. _Real_ applications by Anonymous Coward · · Score: 0

    Can you cite one real (as in "used for real production") CG renderer out there? If not, how come?

    Just wondering...

  146. JVM by essreenim · · Score: 1

    Exactly,

    For me this is the foundation of Java. Don't look at is a language - its strength is its ability to employ its father - c - when necessary.

    For me, Java is much more a framework. It is THE intermediate code (and in my opinion JVM bytecode is the language every student should start off learning, I say controversially!).
    You can even argue for it on ethical grounds.
    It promotes many rivall architectures, as Java is compatible with them all.

    Until someone comes up with a rival intermediated code representation (there is no point in doing this), Java may be around allot longer than you might think. If a rival (final and eternal) intermediate code doescomes along, I believe Sun would be the company to create it.
    But why bother??

  147. Re:Java is a slow cruncher by mabinogi · · Score: 1

    How about you write something that does some serious number crunching, in C, and in Java, using the currently released JDK (1.4.2).

    Compare how long it takes and how easy it is to write in the two languages, and then compare running times.

    Then write up a report and post it somewhere and provide us with links.

    Or you could just google for ancient outdated annecdotal evidence.

    --
    Advanced users are users too!
  148. Java by Penguin2212 · · Score: 1

    The 1994 image took 100 Sparc Station 1's a month to generate.

    Probably because you used Java...

  149. A slightly odd looking mirror (from google) by t_allardyce · · Score: 2, Informative
    --
    This comment does not represent the views or opinions of the user.
  150. I don't want to be your spamhost zombie by Anonymous Coward · · Score: 0

    I bet this thing is a spam relay...

  151. Re:Java can be faster then C sometimes by iwadasn · · Score: 2, Informative

    several things....

    1) Programmer time goes for about $50/hr. That means that a prrogrammer spending 20+ extra hours could have pretty easily bought you an extra dual CPU computer to run the thing on. That's only 2/3 days of work. Java can easily shave off much more than that.

    2) Java isn't that slow. Depends on what you're doing and how you're doing it, but it's not crazy to get java to be less than 50% slower than C. It's also not really uncommon for it to be faster. When it is faster it's almost always because better algorithms are used, but that isn't an accident. It's much easier to write good algorithms with a garbage collector sometimes, as you don't have to track down and delete all the stuff you unlinked.

    3) The one weakness of java (until VM sharing becomes available) is memory usage, but memory is really cheap now, same basic logic as CPU time, but even more so.

    4) Lots of additional optimizations are possible in VM based languages that aren't tried by any modern VM. When they start to come online, expect the performance of the VMs to surpass compiled code. Here are some examples....

    a) Escape analysis: all stack frame scoped data goes on the stack. Basically it makes optimal use of the stack, can't really be improved any. This is why C#'s "value" types are so stupid, they shouldn't be able to help (and would probably hurt) a good VM. Anything larger than a pointer should be a reference, the VM can put it on the stack if it's possible to do so.

    b) Method virtualization: a good VM should strip down pretty much all of the V-tables and just regenerate what it actually uses. This is why the "virtual" keyword in C# is so stupid, it should have no effect on performance assuming a smart VM. Can also do all sorts of inlining that a normal compiler can't do (someone could link to your library, you can't inline away public functions).

    c) "incorrect" optimizations: The VM can create optimal code that is not actually a valid representation of the given code for all inputs. Can then revert the code if an input is given for which it is not valid.

    d) Profiling: a VM can (and modern ones do) profile the code and optimize the common cases at the expense of the uncommon ones.

    e) Hardware knowledge: a VM can always produce code that is optimal for exactly your hardware, right down to cache sizes, processor model, and memory latency.

    Just though I'd throw these things in. Those who expect VM based languages to always be slower will probably be in for a shock in the future. Remember, the cost of compilation is basically constant whereas the payoff from optimizations is linear in CPU speed. At one point the optimizations will exceed the cost of compilation. It's only a matter of time.

  152. If only... by Anonymous Coward · · Score: 0

    ...he'd used a Beowolf cluster.

    He'd have got twice the speed for half the cost, even in 2020 dollers!

    Makes sense when you look at it like that.

  153. But HotSpot compiles and RECOMPILES on the fly by Z-MaxX · · Score: 5, Informative
    can continuously re-optimize code based on the state of the system at that exact point in time. This is the critical point.

    For instance, let's say you have an interface I, and a class X that implements I. If X is the _only_ implementation of I loaded at the moment, then all calls to methods on I can be direct, non-virtual calls because there's only one choice! In fact, HotSpot will even inline the method calls if it decides it will be beneficial.

    But then a class B is loaded. HotSpot will de-optimize the inlined and direct calls to methods on I.

    There are many more examples, such as loop bounds-checking elimination, and other things HotSpot can do because it sees the state of the running system.

    If you've used a slow Java program, it's no doubt the result of a poor design and coding job by the programmer. "I'll just pick up Java for Dummies in 24 Minutes. Now I'm a 1337 j4v4 h4x0r!!" You may also have been using an old, slow JVM. The performance increases between Java 1.2, 1.3, and 1.4 are truly awesome. Also, Sun's Java 1.5 starts up on my machine in less than half the time that 1.4.2 did, and the graphics as OpenGL accelerated now, ... the list goes on and on. For anyone who had used a Java IDE, especially NetBeans/Forte (which I like, except that it's so freakin' slow I fall asleep between operations), you must try IntelliJ IDEA. It is so responsive and just a joy to use. On the systems I've run it on, it is significantly more responsive than Eclipse.

    --
    Dr Superlove 300ml. I use my powers for awesome
    1. Re:But HotSpot compiles and RECOMPILES on the fly by Drakon · · Score: 1

      As an application USER, Everything I've used that was in some way related to Java either didn't work, didn't work intuitively, didn't work until I installed a different JRE, or worked slowly. I don't know enough about computer science to tell you whether Java is or isn't the holy grail of programming, or WHAT it is, but if I see java listed as a dependancy I move along and find something that will compile to native code.

    2. Re:But HotSpot compiles and RECOMPILES on the fly by Viol8 · · Score: 1

      Umm , what you've described is pretty much what an OS memory management and loader system does with normal binaries. Anyway , the whole argument is
      irrelevant because by the time the JIT compiler had figured all this out to perhaps save on a few instruction calls it will have executed thousands of instructions
      itself to do it! In the meantime the standard binary will have chugged away long past that spot. And if you have a JIT that can do a recompile on the fly
      thats another lump of instructions to execute. You can't get something for nothing and at the end of the day a JIT system will on average be slower
      than a precompiled binary all other things being equal.

    3. Re:But HotSpot compiles and RECOMPILES on the fly by badmammajamma · · Score: 1

      Sorry, I call bullshit. Prove it.

      I'm sure you can find some trite examples that prove your point, but I doubt you could provide examples of real world complex apps where this is true. A well written JIT should almost always have the advantage.

      --
      Any man who afflicts the human race with ideas must be prepared to see them misunderstood. -- H. L. Mencken
    4. Re:But HotSpot compiles and RECOMPILES on the fly by Viol8 · · Score: 1

      That would be why high speed compute intensive applications are all written in Java would it?
      Compiling a program everytime its run is an absurd way
      of working and it may be a way of speeding up an interpreted language like java (which is all jvm code is) but no one in their right mind would use it
      for anything else.
      I can just imagine how fast a system would run if everytime someone typed "dir" or "ls" it had to be compiled from source. Gimme a f*cking break!

      If you want examples go google for them , I'm talking from personal experience.

    5. Re:But HotSpot compiles and RECOMPILES on the fly by dup_account · · Score: 2, Informative

      That's the point of HotSpot. It does statistics on the code. If it gets executed once (startup) it never recompiles it. But if the code is being called often enough, it pays to recompile it. For an application like this one, HotSpot would kick butt, and you would end up with some really nicely optimized code (in memory).

      I don't think HotSpot takes nearly as much resources as people think it does, and gains quite a bit with (seemingly) simple optimizations.

      Sun (am probably others) also have a statistical optimizer for their compilers. You compile it, run it with statitics on, then recompile against those stats. It will generate an optimized executable base on the stats.

    6. Re:But HotSpot compiles and RECOMPILES on the fly by Brandybuck · · Score: 4, Interesting

      Java has been out for how long now? Nine and a half years. A whole freaking decade! Yet every damn time someone mentions the poor performance of Java, the same standard excuses are trotted out, with an exhortation to use the new and improved Java:

      1) That's because you're using Java 1.x. Use Java 1.y instead, it's got all these new performance features...

      2) That's because it's using the old GUI toolkit. Use the new one instead...

      3) That was with the old JVM. Use the new one...

      4) That was with the old JIT. Use the new one...

      5) That's because you're using a slow XX Hz CPU. Don't be a tight wad and upgrade to a YY Hz CPU intead...

      Why should I believe you this time? You might actually be right, but I really don't care anymore. You had your chances, nine and a half years of them, so I'm not giving you any more.

      --
      Don't blame me, I didn't vote for either of them!
    7. Re:But HotSpot compiles and RECOMPILES on the fly by Fjord · · Score: 3, Interesting

      I've been sayign the same thing since 1996:

      That's because the programmers don't know how to program.

      I was making systems that output efficient usable applets in 96. I've taken serverside systems that could barely handle a single user to handling 1300 simulataneous users. My experience has been very few people know how to code usable Java, and when their Java is unusable, they give up and say "it's because Java is slow." Of course, I never really believed that since I played a Quake map via an applet on a 200MHz Pentium Pro. I figured if whoever did that could get 30fps, I could have my lists drop down in a timely fashion.

      --
      -no broken link
    8. Re:But HotSpot compiles and RECOMPILES on the fly by orasio · · Score: 3, Interesting

      All those are reasonable claims. If you came bitchin about Slackware 3.4 I would tell you to go use Slack 9.1. You can say that all MS software is shit, but you should bitch about XP, not about win95. Same thing happens with Java.

      The biggest problem is that Microsoft shipped a shitty 1.1 java version for many years, thus people who thought they had java, just had a 4 year old VM.

      Java is faster where it matters, debug time!! I as a programmer am very happy not having to deal anymore with alloc's and arrays out of bounds!

      As most of my current work has a web interface, I like java servlets, because it is easy to program complex systems in java, and _for_me_ it's easier to maintain than php. Servlets are real fast.

      Anyway, java graphical interfaces are very slow. But compared to what? Windows, which takes forever to load its graphical interface? or kde, which takes a looong time intializing some DCOP crap when I want to load the only kde application I use? or gnome? well, gnome is not that slow, but it is slow anyway. I think that anyway, on load times, graphical java application are not the slowest, but among the fastest loaders.

      Now it comes to the issue of hardware acceleration. Windows graphical interfaces are fast because they use some acceleration that slow graphics cards (SIS, anyone?) provide, so windows interfaces are not thaaat slow. When you have a decent graphic card (not a gforcefx5950, just a matrox g100 or a savage4, or a TNT) you start to see that maybe it was not that slow. When you get a faster card, you start to understand that mabe java is just as fast in the desktop as it is in the server, it just was slow in its old version , with old video cards, and in windows, compared to others that were optimized for that situation.

      -- End of rant. --
      Java was always fast, on the server.
      Java was slow, on the GUI, in windows, with old video cards.
      Java is fast, on the GUI too, in any platform, with "new" video cards.

      And, if you don't want to try it, well, I think it's your loss, meanwhile I am going to finish my own photon mapping renderer for java, so I can match up my times with this guy's.

    9. Re:But HotSpot compiles and RECOMPILES on the fly by comedian23 · · Score: 1

      I agree. I moved from a 100% Java Servlet environment to 100% Perl CGI. The Servlets were more than fast enough for everything I asked of them. Neither was a particularly high volume site, but still you can always throw more hardware at the problem.

      The biggest difference is the development costs. I can write Java in about 1/2 the time it takes me to write "proper" Perl(I don't even want to think about C/C++). So over the long run, even if I need to pay $500-1000 for a faster processor, etc. it would still be more than worth it. A faster processor is a 1 time fee, my time is a recurring fee, every time I open a file for development or maintainence.

      The point is that I am probably going to make a migration to Java eventually, once I get a few other projects done.

      So to those criticizing the choice of Java for this project, consider that the author may have had other things on his/her mind other than optimal speed on each and every system. His/her time is money, and a few % difference per machine is of little consequence.

    10. Re:But HotSpot compiles and RECOMPILES on the fly by Brandybuck · · Score: 1

      Java is fast, on the GUI too, in any platform, with "new" video cards.

      Yet another excuse for Java's poor performance: buy a newer video card you cheapass bastard!

      --
      Don't blame me, I didn't vote for either of them!
    11. Re:But HotSpot compiles and RECOMPILES on the fly by orasio · · Score: 1

      Perhaps you didn't understand me.

      You were told to get a new java and a new machine. You complained here on slashdot.
      I explained you why you had been told to get a new java and a new machine, that there was some fundament behind that. If you didn't read, I just told you that only in the past was java slow, and in the present and the future it is not. The problem is with people that want the technology of today and tomorrow running on yesterdays software and hardware.
      You may like it or not, but I have already answered that in my post, this is not "yet another excuse", it is an explanation why "get another machine" is the reasonable thing to do if you have speed problems with java.

    12. Re:But HotSpot compiles and RECOMPILES on the fly by Anonymous Coward · · Score: 0

      I totally agree, if your using the old hardware/JVMs upgrade, unfortunately on corporate projects whereby the most they will probably use a PC for is either Cytrix or some other telnet based application, upgrading isn't an option. I have a project that runs on OAS/OC4J 9, requires Java 1.3 (1.4+ will not work with the version we have) and the company has been licensed to use it for the last couple of years and only now wants to use the Java App Server side. There is alot of functionality in 1.4 I could be using to make the job easier but I have to go without for now or rely on third party options.

      There are a different features I want to introduce into the App, Java based GUIs via Java Webstart, applets for example, but as the PC's are old, only good enough for telnet based apps I don't think thats gonna happen.

      People look at applets saying they are slow and useless - I have seen some really good applets put to work and compare loading times of a Flash version!

      I support Java apps in the workplace but unless there are ways to convince management to upgrade the hardware I can't make full use of it.

      tne

    13. Re:But HotSpot compiles and RECOMPILES on the fly by Anonymous Coward · · Score: 0

      Oh, I don't know. If I had a 10-yr old Sun Ultra 5 workstation, and was complaining about it being so slow (for any software operation), wouldn't the first thing you would suggest be to upgrade the hardware?

      It's really no different.

      That it is so trivial to install a new JDK really ignites your strawman on fire...

      Software, like hardware, changes (hopefully for the better...). Like it or not, there comes a time to upgrade it all.

      Otherwise, we'd still be running stuff on 80386's or 68020's, right? Or, heck, writing 3270 UIs and JCL/ASM code...

    14. Re:But HotSpot compiles and RECOMPILES on the fly by angel'o'sphere · · Score: 1


      You can't get something for nothing and at the end of the day a JIT system will on average be slower than a precompiled binary all other things being equal.

      Bull shit bingo.

      Why would one invest time and money creating HOT SPOT technologies and similar if the outcome was not worth it?

      BTW: probably you should google a bit ... there are plenty of publications e.g. on acm.org and hewlet-packard.com about benefits of HOT SPOT compilation.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    15. Re:But HotSpot compiles and RECOMPILES on the fly by Anonymous Coward · · Score: 0

      Java is or isn't the holy grail of programming

      Java is not the holy grail of programming, but it is the right tool for the job in many cases. If you've had a bad experience, it was because people were using Java incorrectly or as the wrong tool for the job. It's quite simple as that.

    16. Re:But HotSpot compiles and RECOMPILES on the fly by Viol8 · · Score: 1

      Because it allows Java/whatever to be platform independent but be compiled! It has nothing to do with utlimate performance. Hello??!

    17. Re:But HotSpot compiles and RECOMPILES on the fly by Viol8 · · Score: 1

      "That it is so trivial to install a new JDK really ignites your strawman on fire..."

      Really? You ever tried downloading 100 megs over dialup? Get a clue pal...

    18. Re:But HotSpot compiles and RECOMPILES on the fly by Anonymous Coward · · Score: 0


      That's what I thought the first time too, but after two years I started wonderign

    19. Re:But HotSpot compiles and RECOMPILES on the fly by marcovje · · Score: 1


      HotSpot is great. But that means it is able to get somewhat closer to normal compiled languages than the old bytecode interpreter with its GC storms,.

      Not that it is suddenly the apex of performance (except compared to the old bytecode interpreter)

    20. Re:But HotSpot compiles and RECOMPILES on the fly by SoTuA · · Score: 1
      you must try IntelliJ IDEA. It is so responsive and just a joy to use. On the systems I've run it on, it is significantly more responsive than Eclipse.

      It probably is more significantly more responsive than Eclipse, but it made my wallet a little numb. It sets me back US$499 more than Eclipse!

      (to put in a little perspective, I live in a part of the world were that $499 dollars pay the rent of my 3-bedroom flat and buys almost all my groceries for one month)

  154. Re:Java can be faster then C sometimes by Anonymous Coward · · Score: 0

    LOL!

    OH MY GOD YOU ARE UP LATE!

    F"en asdo crazy man

    LOLFMAOMO@!

    hahaha

  155. Re:Wireless or not... by Anonymous Coward · · Score: 0

    Way to plagiarize, loser.

    http://developers.slashdot.org/comments.pl?sid=8 16 00&cid=7165838

  156. Why is this an interesting image? by Anonymous Coward · · Score: 0

    Can someone explain why this scene was selected to be raytraced?

    I see there are some interesting things in it, such as the rainbow reflection in the mirror, but what specifically is technically interesting about the composition of this scene?

  157. Re:Java? No wonder you need cpu cycles. by merlin_jim · · Score: 1

    Eh... .NET is natively compiled when it's run for the first time. It also optimizes for the platform (even CPU) it runs on.

    Actually, most programs native compile it during the install. Only if the assembly is not natively compiled does it get so on load time...

    --
    I am disrespectful to dirt! Can you see that I am serious?!
  158. One Month ? Just give me 5 minutes... by tdhdeep · · Score: 1

    The 1994 image took 100 Sparc Station 1's a month to generate

    Just give me 5 minutes and photoshop :)

  159. Re:Java can be faster then C sometimes by arkanes · · Score: 1

    While most of what you said is true (although I should point out that fully half your post is about cases where Java may become faster, rather than cases where it is faster), #2 isn't valid - an algorith isn't "faster" if you just ignore the memory issues, because the garbage collection overhead is real and signifigant. Java profiling ususally disables GC and ignores startup time, but you could write the exact same thing in C and just let all your pointers leak all over. Memory has to be dealt with somewhere, and just ignoring GC and claiming you've got a better algorithm because you don't have to free memory is dishonest.

  160. Re:Java is a slow cruncher by Furry+Ice · · Score: 1

    The bytecode for a method declares the maximum size the stack can grow to within that method. If this number is small enough, everything can be stored in registers.

  161. I think this is beside the point. by donscarletti · · Score: 1
    Well, if you don't have the source and the binary you got is for an old 386, then you're stuck. Te cool thing with java is that already bytecode compiled code can be optimised on the fly
    Correct me if I am wrong, but since this argument is about the initial choice of language, isn't the argument about whether it is a waste of users clock cycles to write things in java that is to be put to immediate use? Not whether old things written in java will be better than native code without recompilation.

    When someone writes a new program, the question of how well it would run if this person was in fact not writing this program and only had an obsolete copy lying around is fairly irrelevant when they choose the language that they will use.

    Your argument is like a jockey saying: "well, I have a three year old tortoise and a three year old thoroughbred horse. But hypothetically if I didn't have them and I had a 50 year old horse and tortoise, the tortoise would be faster because the horse would be dead. Therefore I should probably race on my tortoise at the track today.

    --
    When Argumentum ad Hominem falls short, try Argumentum ad Matrem
  162. Sick of the clueless blasting Java performance... by Jerk+City+Troll · · Score: 3, Informative

    This thread is already full of very knowledgable people expoudning at great length as to why Java is not slower (and infact, is often faster than "native code"). Therefore, I will not waste my time writing an indepth response to those who would argue that 1 + 1 in Java is somehow slower than 1 + 1 in C/C++. This post does that quite well. What that comment does not do, however, is explain why some Java programs do, in fact, feel slower than native programs.

    I'll simplify this as much as I can without diverging from the technical truth too much. Most complaints that Java is slow come from two sources. First, you must wait for the virtual machine to load, and depending on the libraries used by the program, that can be costly in terms of IO, which is always very slow. Second, Java's GUI toolkits are fairly heavy weight--they do a lot and many programs take advantage of much of the functionality they provide. I won't embark into the details, but to those inclined to find out why should read more about Swing and what Java2D libraries offer. Because of all they do, many Java programs with GUIs feel a little sluggish. Of course, keep in mind that most software sits idle 99% of the time while the user decides what to do. So otherwise, Java code that is not bound by user response time is very fast.

    One quick post script: because the Java language is object oriented, complex software will do a great deal of memory allocation and garbage collection as objects come in and out of use. That too, is very expensive. However, there is no reason that you have to use the Java programming language to code for the virtual machine. Case in point: Jasmin. In theory, you could write compilers that generate JVM bytecode from any language (and a former professor of mine is currently in the proceess of writing a book that explains precisely how to do that).

  163. Speed an issue - then why Java? by aksansai · · Score: 2, Insightful

    Having been exposed to so many different languages, I'm not quite understanding the selection of Java for processor intensive applications when so much more is offered - all the while keeping the spirit of platform independence. Not to troll, but if I'm running processor intensive simulations, I want to take advantage of the processor power available to produce a result in the least amount of time.

    Being an regular software developer and a web applications developer, I have found the versatility of Java does not outweigh the performance penalty attributed to emulated code execution. Java (historically) does not, in my opinion, adequately take advantage of new processor features (MMX, SSE, etc.) to accelerate code execution. I believe, in fact, it was only announced recently that Sun would be aggressively adding better MMX and SSE support in the virtual machine. Even poorly written C++ code will be optimized by a smartly written compiler to run very fast.

    Could Java's lack of aggressive optimization be due to Sun's focus on reality being away from the most popular instruction set on the planet for personal computing (x86)? Further, why re-emulate the same byte-code over and over? The JIT has to produce the equivalent native language codes to get it to run on a particular processor platform. Why not cache these codes (like what DEC did with the Alpha's x86 interpreter or like .NET's CLR compiler)? Nonetheless, Sun has much learning to do to make Java the "answer to all problems" language it was touting in the later 90's. While people may believe that opening the source of Java is the answer, I firmly believe that like C++, Java is beginning to show its age.

    There are emerging languages and technologies that are attempting to complement older languages, provide the wealth of structure that Java has laid out, but still build further to make it that "answer to all problems" language. Sun's interdicting hold on Java makes its development as fast as its developers and contractors can muster. Other companies or open source communities have the potential to make great strides in rapid development. Look where C# is (upon the Mono or .NET platform) in the last few years compared to Java in the first few years.

    A side arc (experiment, if you will) would be to port the application to C++ and to C# (CLR) and run the calculations on both Windows and Linux - take a comparison against Java running on those two platforms. I believe it is quite obvious WHICH language(s) would be declared the winner. So, instead of us having to dedicate a few trillion cycles, maybe one trillion would do.

    --
    Ayup
    1. Re:Speed an issue - then why Java? by Anonymous Coward · · Score: 0

      You should have also mentioned that if he wrote in plain C his program would also run on ten times as many different machines and operating systems...

    2. Re:Speed an issue - then why Java? by spongman · · Score: 1
      Think about it for a second. You're asking: why does a company that makes most of its money from selling hardware have a vested interest in producing software that makes peoples programs run slower?

      To sell more hardware?

  164. Does anyone check before they moderate? by donscarletti · · Score: 2, Insightful

    Funny, I allways thought that the 80386 was a 32 bit machine, I thought it was actually the first *86 to have has the EAX register and the STOSD instruction (but strangely not the STOD instruction)

    --
    When Argumentum ad Hominem falls short, try Argumentum ad Matrem
    1. Re:Does anyone check before they moderate? by willdenniss · · Score: 1

      He's trying to illustrate the point which is very valid. Just because the examples are inaccurate doesn't invalidate the point - therefore it gets moderated up.

      Will.

  165. Re:Java? No wonder you need cpu cycles. by pohl · · Score: 1
    C++ as a language is a superset of Java as a language.

    By what meaning of the word "superset"? By some interpretations, one would expect to be able to take a Java progam and successfully compile it with a C++ compiler, which obviously isn't true. This would be a reasonable interpretation, since the "superset" idea is often applied to language pairs like C/C++ and C/ObjC. One genuinely can compile a plain C program with a C++ compiler or an ObjectiveC compiler.

    So, if that's not the intended meaning of "superset", then you must be claiming that there are semantic constructs that you can do in C++ that you cannot do in Java, but not the other way around. multiple-inheritance-of-implementation and operator-overloading would be the obvious examples for things that C++ can describe that Java cannot, but then Java provides runtime access to class names, method names, and instance variable names...while C++ does not. So again there's not a true superset/subset relationship here either.

    --

    The "cue the foo posts in 3, 2, 1..." posts will commence with no subsequent foo posts in 3, 2, 1...

  166. Re:Java is a slow cruncher by jabbadabbadoo · · Score: 1

    That's pure theory and doesn't work out in real life. Why? Because the registered are occupied with VM internals (to speed up VM loops, in particular)

  167. Outsource the cycles by scovetta · · Score: 1

    You should ask over on indiadot.org (sorry, unintentional pun), they're cycles are a tenth of the price.

    --
    Wer mit Ungeheuern kämpft, mag zusehn, dass er nicht dabei zum Ungeheuer wird. --Nietzsche
  168. First time... by scovetta · · Score: 1

    ...an email address has been slashdotted Oh yeah, except for that spammer.

    --
    Wer mit Ungeheuern kämpft, mag zusehn, dass er nicht dabei zum Ungeheuer wird. --Nietzsche
  169. View photons at home, $25 by morcheeba · · Score: 2, Informative

    You can view individual photons with a Spinthariscope - that web page has a good description, and it's $25.

    1. Re:View photons at home, $25 by richie2000 · · Score: 1

      Cool gadget. However, I can't but help feeling the name is poorly chosen. I kept squinting, half expecting to find the goatse guy gaping at me on the page... *shudders*

      --
      Money for nothing, pix for free
  170. Re:Java is a slow cruncher by edwdig · · Score: 1

    These days, processing cycles cheap, programmer time expensive.

    That claim is valid (to an extent) when you're talking about something running on one machine, or a small number of them.

    This is a project that's going to run for a month on hundreds of machines. Lets assume 30 days on 500 machines. That's 15,000 computation days. Say he spends one day making the code 1% faster. That one day of time results in a gain equivalent to 150 computation days. In this example, 1 day of work was equal to adding 5 more computers to the project. You'd have to be taking in a really big paycheck for that optimization to not be worth it.

    Keep in mind that a lot of posters on this story are claiming that a 2-4x speed increase by rewriting in C would be realistic. Assuming that's true, a C version would be well worth doing.

  171. Free distributed computing services from Ubero by shodson · · Score: 1

    We are offering free distributed computing services to people who have worthy projects they want to run across our network over thousands of members around the world on their PCs. If you got an algorithm and some code, we've got a lot of bandwidth and processing power. If your project is cool, or of worthy scientific or societal interest, and not too onerous to integrate into our platform, then we would like to process your projects for free.

    For more information visit http://www.ubero.com/freeservices.asp

  172. FINALLY PROOF by Anonymous Coward · · Score: 0

    I know you've all been waiting: here is the final word on Java vs. the world.

    Emacs starts up faster than JEdit, therefore Java loses. Emacs is obviously the most complicated program ever invented! LOLOLOL!

  173. Re:Java? No wonder you need cpu cycles. by sploxx · · Score: 1

    How old is your C++ standard you're refering to?
    This is one of the 'PR' problems of C++, early implementations had many deficiencies and people are refering to old information.

    Fact is: C++ has RTTI - run time type information. Try it out, it's nice :)

  174. Mangled Email address? by Anonymous Coward · · Score: 0

    rkeene517.... why'd'ya mangle your email in the body of the article, when the very first bit of
    the post already contains your email in perfect form?

    ah well, guess you weed out the 'also rans' before
    wasting your time mailing them with the .zip'd
    workload

  175. What? by Anonymous Coward · · Score: 0

    Aay! I dont know WHAT IS THIS, but you could render this image in a day on a 486 with POV-RAY

  176. Re:Java? No wonder you need cpu cycles. by Anonymous Coward · · Score: 0

    >This in fact should get modded flaimbait or troll.

    >It's no use, fellow AC, spare your fingers. You can lead a rightwinger to the facts, but you can't make him read or think.

    So in other words you're going to pay attention to his sig and not his post?

    Now who isn't reading or thinking?

  177. Render the "Double-slit experiment" by LuckyStarr · · Score: 1

    Hey. Lets render this. If it works out, this guy will have my kudos, which of course isn't worth anything. ;-)

    --
    Meme of the day: I browse "Disable Sigs: Checked". So should you.
  178. Re:Sick of the clueless blasting Java performance. by jafuser · · Score: 3, Informative

    Second, Java's GUI toolkits are fairly heavy weight

    This is probably why SWT came about (in part thanks to IBM).

    The first application to use SWT, Eclipse, doesn't feel like a java application because it's using native widgets, which gives the GUI a very snappy response.

    If the only strong reason you have avoided programming applications in Java is because of their slow GUI response, I suggest looking into SWT. =)

    --
    Please consider making an automatic monthly recurring donation to the EFF
  179. Java = 1 month, C++ = 1/2 week, C++ A* = 1 day by Anonymous Coward · · Score: 0
    Its distributed algorithm in Java is the worst trial-and-error algorithm of this history.

    We would implement it in C++ using the A* algorithm, a heuristic technique of Artificial Intelligence.

    open4free (c)

  180. Re:Java can be faster then C sometimes by iwadasn · · Score: 1


    True, I was partially keeping to cases where it could (and someday, presumably, will) be faster. Anyway, I'm not claiming that you can turn off garbage collection. I'm claiming that people can often write better algorithms when they don't have to manually manage memory than they can when they have to track down every pointer that might become unreachable and delete it.

    I just don't like the assertion that much of slashdot makes that VM languages will always be slower. In the long run the reverse should be true. The first cars were slower than horses, but it was only fools who believed that would long be the case. Slashdot seems full of such fools.

  181. Slashdotting a mailserver? by xandroid · · Score: 1

    Hmm...

    --
    $ echo "ceci n'est pas une pipe" | sed -Ee 's/(eci n|pas )//g'
  182. the link for his email by winse · · Score: 1

    has BUTNOSPAM in it in the link he provided, but the link from his username doesn't. hmmm that sounds less effective.

    --
    this sig is deprecated
  183. Why? It is Art! by j-stroy · · Score: 1

    With greatest respect to all the brilliant coders, there are just somethings which are "out of the box".. that can't be arm waved and approximated into submission. This is obviously a true experiment (and capital A Art), there is no room to fudge the numbers.. even if they are close.

    You all know the scientific method.. Do not forget about the artistic process. Both require getting your hands dirty to produce empirical results. The original image has a certain ineffable realistic quality which even the best renderers generally lack. Hats off to this artist's endeavour!

  184. my personal photon by paulie_1 · · Score: 1

    Will I get a copy of final picture with small red circle around the photon that I helped to compute ?

  185. C# same way by KalvinB · · Score: 1

    I started working on some computationly heavy statistical distribution equations in C++ in order to prototype some functions. I used doubles for eveyrthing because I needed the precision.

    When I moved it over to C# the speed went noticibly up.

    But then again compiled QuickBASIC could do math as fast as any other language. It was just the graphics that were slow. Fast math isn't much of a trick since all the basic computations are done in hardware. The compiler just needs to take advantage of it.

    If you need real time, new and delete are about 10 times slower than free and calloc. You don't have access to those functions in Java or C#. If you need raw speed, higher level languages aren't going to cut it. They have too much "safety" built in which kills performance in some cases.

    If all you need is math, then any language will do.

    Ben

  186. 32/64 bit? by Anonymous Coward · · Score: 0

    If its in java it can be run on 32/64 bit processors just the same.. Well, almost. I've heard that a rocket slightly missed its trajectory because the inintial computation was done on 64 bit machines and then transfered over to 32.

    Wouldn't the data be kind of pointless if different machines will introduce different rounding errors?

    best regards

    Oleg M

  187. You rendered for a month... for THAT? by ReadParse · · Score: 1

    I"m sorry, I know this is incredibly naive of me. Go ahead and mod me down, I know I deserve it. I have some karma to spare. I'm sure I'm just ignorant of what this really is and what makes it so cool. But you ran 100 machines for a MONTH and you got THAT?!?! It just had to be said. Seems like you could have rendered Manhattan or something in the same amount of time.

    Again, pure ignorant drivel here. I just couldn't pass it up.

    RP

    1. Re:You rendered for a month... for THAT? by Anonymous Coward · · Score: 0

      Dude! You aren't in computer graphics, are you? It's an unstated rule by all academic computer graphics journals that unless your renderings consist of at least 51% shiny plastic balls they're not going to get published. A checkerboard floor is a big plus, but don't count on that alone to get your foot in the door!

  188. Re:Java? No wonder you need cpu cycles. by pohl · · Score: 1

    I was only half-aware of RTTI; thanks for pointing that out. I read a bit about it this morning, and it looks like the capabilities that it provides is a strict subset of those provided by the reflection facilities in Java.

    --

    The "cue the foo posts in 3, 2, 1..." posts will commence with no subsequent foo posts in 3, 2, 1...

  189. Can you waste a few trillion cycle.? by Anonymous Coward · · Score: 0

    Why waste CPU time writing it in Java if it's computationally intensvie. Write it in C, and compile for various platforms.

  190. Re:Java is a slow cruncher by 6Yankee · · Score: 1

    And pigs _can_ fly.

    DAMN those police helicopters!

  191. Deja vu... by Anonymous Coward · · Score: 0

    I've already seen this comment. In another, much older story...

    Guess the trolls are plagarizing again (unless this AC is the OP?), though I suppose it doesn't matter since they're not getting any karma to post Goatse ASCII at +2 ...

  192. Re:Sick of the clueless blasting Java performance. by Brandybuck · · Score: 1

    Excuses, excuses, excuses. Java has been out nine years, and I'm getting tired of all the damned excuses.

    --
    Don't blame me, I didn't vote for either of them!
  193. Re:Java? No wonder you need cpu cycles. by sploxx · · Score: 1

    Reflection is part of the java class library, not the language.

    This is why I was calling for an equivalent C++ class library (or a link C++->Java Class Library). C++ with JVM backend should of course have access to all the capabilities provided by the JVM.

  194. Re:Java can be faster then C sometimes by arkanes · · Score: 1
    Well, theres _always_ more overhead with a VM language. The question is whether or not runtime optimizations from JIT can overcome the VM overhead, and so far the answer is sometimes. Of course, as we get more and more power and memory the overhead becomes less and less a factor.

    Now, as for your claim that you can write better algorithms - algorithms don't care about memory, thats an implementation detail. And keeping track of every pointer and when it might go out of scope is exactly what GC does. It's fundamentally less efficent than manual memory management - a tradeoff of runtime performance for ease of implementation. Although, again GC overhead gets flattened out as computers get more powerful.

  195. Re:Java is a slow cruncher by voodoo1man · · Score: 1

    Sun doesn't provide their own JRE for the BSDs, and FreeBSD's JRE is only at version 1.3.1 (I don't even know if this much is available for NetBSD and OpenBSD). If you want the current JRE (1.4.2), you're going to have to pay for a commercial one. On the other hand, GCC and the GNU C library work on all the platforms you mention (and many more besides that, some where a JRE does not even exist). In a way, it's not surprising that ISO C is the most portable language available, but when you look at the calendar, it is also kind of sad. This is of course talking about source distribution, but when some person on Slashdot asks to run his programs on hundreds of other people's computers, it would be a little suspicious for him not to provide the source code.

    --

    In the great CONS chain of life, you can either be the CAR or be in the CDR.

  196. Open source Distributed computing Hub by Anonymous Coward · · Score: 0

    It actually seems to me that it could be cool to create a an Open source distributed Computing Hub. Tasks like this that are finite in a meaningful length of time could be farmed out...
    That is set up a site and some software that downloads the next tasks - and computes till its done (you know - maybe limit these things to 1 - 3 months or something. In fact technically - at first thought - this seems easy...) The harder issue would be to prioritise the tasks.... Is my spin glass project better than my photon task and so on (ANd Ive always meant to write a evolving algorithm that tries to predict the stock market on the basis that given enough CPU your bound to find something that works !!!)
    I have access to 3 Intel PCs with another soon AND also on occasion a 10 CPU Sun Server that sits there unused on weekends and over night .... thats a lot of power wasted...
    Does anyone know of anything like this in the works ? What do people think?
    phill@wall.name (too lazy to login )

  197. Re:Java can be faster then C sometimes by Wolfier · · Score: 1

    I'll bite.

    WHO still runs 386 these days except for nostalgic reasons? Did you run 286 in 2001?

    With low CPU prices these days, running anything but the simplest programs on a 386 (especially if you want performance out of it) will probably cost MORE than say, a Pentium.

  198. Re:Java? No wonder you need cpu cycles. by karlm · · Score: 1
    I agree that it would be nice to have many common languages that will compile well for a common virtual machine. Java is a nice language, but I also really like Ocaml, Python, and other languages that aren't easily expressed in JVM or .NET CLR bytecode.

    The JVM and .NET CLR both enforce a strongly typed object model at the lowest levels. As much as Microsoft would like you to think otherwise, the .NET CLR leverages heavily on Microsoft's experience writing a JVM. Both virtual machines can trace their lineage to Sun's Oak project, designed to express the symantics of only a strongly statically typed language and be interpretable on 8-bit microcontrollers in toasters and fridges. Stack based virtual machines are simple to implement and are nearly ideal for interpreters (see Xavier LeRoy's design paper for Zinc, the Ocaml VM) but very much not ideal for just-in-time compilation (see Ken Tompson's design paper on Dis, the Inferno OS VM). There's simply a lot of work that has to be done in order to get the abstract syntax tree back out of the stack-based byte code.

    Essentially, your stack-based bytecode is optimized for a two-register machine (the top two values on the stack). If you're close to having only two spare registers after the VM claims a couple for overhead, then directly JIT compiling stack based VM code doesn't create code that's that bad. In this sense, stack-based JIT VMs aren't so bad on register-starved architectures like x86. However, on architectures like x86-64, PowerPC, Itanium, and Sparc, and MIPS, you really want to work backwards from the bytecode to the AST and then generate RTL and finally do register folding on the RTL so that it will run on the number of registers you really have.

    On the other hand, Parrot bytecode with its 3 sets of 16 registers can probably be directly translated to RTL and generate very good code on most architectures. (Itanium has many more than 32 GP and 16 FP registers, so it will take a lot of work to get Parrot to take full advantage of Itanium. Register folding even on x86 should take much much less time than AST and RTL generation from stack-based bytecode.)

    Finally, the Dis virtual machine has more or less 4 billion registers (it's a memory-based virtual machine). If a partucular routine for Dis takes more registers than physically available, then your JIT compiler will need to perform register folding, but for most machines with fewer than 4 billion physical registers, Dis should generate good native code very quickly and easily.

    Something like Parrot or Dis would make a much better target for a C++ compiler because of the less restrictive object models. If you wanted pointer safety or a more strict object model, that could be enforced more flexibly in the (replaceable) class loader than in the VM's low-level functionality.

    There's also the point that the JVM provides no opcodes for pointer arithmetic and no way to cast between pointers (references) and integers. Using a class loader that allows integer opcodes when a reference is on top of the stack will break on VM implementations that use a seperate reference stack to improve garbage collection. You could have all of your objects live in an array of ints and emulate pointer arithmetic with index changes and bit shifts, but that makes using standard Java libraries with your objects much more difficult and slower.

    --
    Copyright Violation:"theft, piracy"::Anti-Trust Violation:"thermonuclear price terrorism"<-Overly dramatic language.
  199. What does he really want the cpu time for? by Fishtank · · Score: 1

    I have no reason to expect that he will whisk out a boring image of some glass balls that he rendered in (e.g.) maya in 5 minutes... So what's the rest of the processing time for?

  200. Yeah, sure... by Gruneun · · Score: 2, Insightful

    I'd do it if I were allowed to get the source, then compile myself.

    I love this argument. I hear it from more than a couple people who "want to know exactly what that programmer is up to" before they run it on their own machine. None of them actually read the code. In reality, they want people to think that they can comprehend someone else's code, while truly only proving that they can run a makefile.

    I write clear, organized code and I place clear, concise comments where needed. I work with some intelligent, organized people who do the same. The reality is that, even being fully comfortable with their coding styles, I find it very tedious to read their code... even when I know exactly what they're attempting to do. Somehow, I doubt that most people, even programmers, could comprehend the math that goes into the typical raytracing program, let alone one developed by a complete stranger.

    1. Re:Yeah, sure... by k8to · · Score: 1

      The old chestnut.

      The point is NOT that every person reads the code, but rather that it is available for inspection and review. Trust flows more easily from the knowledge that the system can be readily inspected and analyzed and that the author has done what he or she can to enable that, than it does from nothing at all.

      Sure a very clever person might be able to hide malignant behavior rather effectively in a nest of source, but a whole class of human activity and anlysis tools can be employed to vet source code which are difficult to use without it.

      --
      -josh
  201. Fortran by Lux · · Score: 1

    Others who've replied have been a little off, but they raise good points. F90 is around, which is more feature-rich than F77, but pretty close to backwards compatible. No one switches over to F90. Why?

    Well.. F90 supports pointers.

    Yep. That's it, really. F90 has pointers. Not having pointers is why F77 can compile to greased lightning on crack. This is critical when your supercomputer time (variable expense) is at a premium with respect to your salaried coder's time (fixed expense) and you're working off a grant (with finite cash but loose deadlines.)

    And yes, I'm young and I still know Fortran. Like my father and his father before him.

  202. Swampped by email by rkeene517 · · Score: 2, Informative

    I have received about 900 emails today. I will be posting the program on http://www.cpjava.net in a day or two so everyone can download it. Not to self: don't post email address :-(

    --
    Inside every complex program is a simple solution trying to get out.
  203. Can't handle truth? by Anonymous Coward · · Score: 0

    Why is this a troll? It's true software is getting bloated because new hardware is cheap. It's people who keep suggesting to throw hardware at the problem make software bloated.

    Why would you need tons of CPU cycles now to do the same thing you wanted to do 10 years ago?

  204. wrong email? by Anonymous Coward · · Score: 0

    hi, im interested in participating, but when i sent you an email to the address provided, i got a return email saying your address is not valid.. my email is illusions0912@hotmail.com i would like to participate

  205. Whats the benefit of the image? by alicethehonkey · · Score: 0

    What will having this image do/help? Im all for supporting things that will help society in some way or another, but this just seems to be a picture atm??

    --
    alice@ozforces.com
  206. Why? by Jacek+Poplawski · · Score: 1

    Maybe I don't understand something [1], but image looks just poor. Why should anyone donate cpu cycles for producing such image? What's the point?

    [1] It's a science project, not fun, but what exactly can be read from this picture?

  207. *sigh* Java's not slow anymore. by mactari · · Score: 1

    Sheesh. People -- headless Java apps aren't slow. Java compiles the code with a "Just In Time" (JIT) compiler, so you may experience a bit of a delay the *first* time the app does any one function as the bytecode is "really compiled", but after that, there really isn't an issue. In benchmarks that remind me more of the Apple vs. Pentium Photoshop numbers than anything else, you can certainly find people who experience *faster* execution times in Java than in native code [using compiler X]. It all depends on what you're doing. But that you can even venture that Java is faster at some things now tell me it's up to speed.

    What's slow about Java and where does the conception come from?

    The main culprit is Swing, Sun's preferred GUI toolset, which is gosh awfully derned slow. Unfortunately GUIed applications (like Limewire) are where many people form their Java speed impressions. Here, Swing (perhaps more properly, the implementation of Swing) is relatively slow compared to native GUI code on most every platform. I've heard it said that Swing is good for debugging server-side apps, and sometimes, I regret to admit, I think that statement's more on the money than off. When you compound the problem by creating a relatively complex GUI like Limewire or Netbeans, you really see the problem.

    (Luckily it looks like that might be changing. And try Eclipse, the Java IDE from IBM, and compare to Netbeans, Sun's Java IDE. Both are built in Java. Netbeans uses Swing and runs dog slow at times. Eclipse uses SWT (see above link) and flies.)

    What else is slow? The *first* time you start your Virtual Machine -- again, depending on how the program's written, and particularly slow when you have to get Swing up & running -- can take a while.

    But take Apple's virtual machine. The first Java app that starts can often speed up each that follows -- and restarting the same app a second time without rebooting will cut startup times dramatically as parts of the VM stay on the ready.

    Anyhow, I digress. The point of it is that you can use JIT compiling to make your bytecode run quite quickly, expecially for GUIless application. Do you really think so many large companies would use Java for their web presence if Java couldn't at least move bytes around quickly? Sun's smart enough to compile Java into native code in the VM (that's its job, after all), and when you're just dealing with numbers, after the first compile from bytecode, "Java is C", in a sense.

    --

    It's all 0s and 1s. Or it's not.
  208. Crack des in one month! by fredu · · Score: 1

    Now you can put your computer where your mouth is (?) and help us crack DES i one week. We have a distributed system, and a client written in C/Assembler that contacts the server, gets three bytes and it checks all alternatives that start with those three bytes. Interested? Read more here!

    So the question is: can you spare us a few million cycles?-)

    --

    I came up with this tag first!
    /fredu