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."

128 of 570 comments (clear)

  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 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

    2. 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.

    3. 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.

      --
    4. 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).

    5. 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.

    6. 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.

    7. 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.

    8. 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.

    9. 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.

    10. 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.

    11. 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....

    12. 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.
    13. 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.

    14. 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
    15. 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!
    16. 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.
    17. 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.

    18. 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? ;-) ]

    19. 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.
    20. 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.

    21. 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.

  2. 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)
  3. 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. 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 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

    2. 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?
  5. 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 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.

  6. 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.
  7. 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.
  8. 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

  9. 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 Exiler · · Score: 2, Insightful

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

      --
      Banaaaana!
  10. 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 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.

    3. 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.

  11. 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 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.

    2. 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.

    3. 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
    4. 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.

    5. 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.

    6. 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.

    7. 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
  12. 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...

  13. 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 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.

    2. 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).

    3. 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.

    4. 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
    5. 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.

    6. 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 ^_^
  14. 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

  15. 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.

  16. 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.
  17. 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 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.
  18. 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 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.
  19. 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.

  20. 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
  21. 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.

  22. 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.

  23. 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.
  24. 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.
  25. 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 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.

    2. 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.

  26. 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.

  27. Re:Bad link by mirko · · Score: 4, Informative

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

    --
    Trolling using another account since 2005.
  28. 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
  29. 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

  30. 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.

  31. 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.

  32. 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.

  33. 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.
  34. 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
  35. 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.

  36. 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.

  37. 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!
  38. 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 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
    2. 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.

  39. 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

  40. 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.

  41. 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
  42. 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.

  43. 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!

  44. 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.

  45. 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
  46. 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.

  47. 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.

  48. 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
  49. 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.

  50. 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.

  51. 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.

  52. 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 .

  53. 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.

  54. 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!
  55. Re:Java? No wonder you need cpu cycles. by fishnuts · · Score: 2

    hmmm. like perl!

  56. 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.
  57. 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.

  58. 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 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.

    2. 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!
    3. 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
    4. 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.

  59. 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).

  60. 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
  61. 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
  62. 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.

  63. 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
  64. 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.

  65. 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.