Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Can You Spare A Few Trillion Cycles?

timothy posted more than 10 years ago | from the distributing-the-light dept.

Graphics 570

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

cancel ×

570 comments

Sorry! There are no comments related to the filter you selected.

WOOHOO!! (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#8845531)

OMFG!!! FLCL is coming back to cartoon network!!! WOOOOOOOOOOOOOOOO!! Furi Kuri!!!!!

The question is,, (-1, Offtopic)

The Slashdotted (665535) | more than 10 years ago | (#8845532)

can you spare a few terabytes of bandwidth?

Java eh? (5, Funny)

Anonymous Coward | more than 10 years ago | (#8845535)

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

first!!!!!! (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#8845536)

insightful, yes?

No posts and the site is already slashdotted. (-1, Redundant)

dannycarroll (180967) | more than 10 years ago | (#8845540)

That will teach him. Must be hard to do any rendering with that server overheating.

Mirror (1, Informative)

Anonymous Coward | more than 10 years ago | (#8845571)

Don't sweat it, I got a copy of the linked image [lerfjhax.com] .

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

Re:No posts and the site is already slashdotted. (1)

martingunnarsson (590268) | more than 10 years ago | (#8845617)

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

Bad link (1)

tulare (244053) | more than 10 years ago | (#8845544)

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

You must be new here. (-1, Redundant)

BlastM (663010) | more than 10 years ago | (#8845588)

This is the mysterious phenomenon known as the "SlashDot Effect" in action. Nobody is quite sure how it is caused, but it affects small servers on slow connections that host large images.

Re:Bad link (4, Informative)

mirko (198274) | more than 10 years ago | (#8845726)

I added "www." to the URL, it works.
Try this [cpjava.net] ...

Dude, you should try out China (5, Funny)

alphakappa (687189) | more than 10 years ago | (#8845546)

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

^^ This isn't me, BTW. (-1)

Anonymous Coward | more than 10 years ago | (#8845690)

Really.

More distributed processing (4, Insightful)

isugimpy (769087) | more than 10 years ago | (#8845550)

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.

Re:More distributed processing (-1, Flamebait)

BigDave3k (770831) | more than 10 years ago | (#8845616)

So would you be for or against turning off SETI@home so I can work on this yahoo's picture?

Real URL to image (3, Informative)

FrenZon (65408) | more than 10 years ago | (#8845551)

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 [cpjava.net] (you may want to do a 'Save Target As', as the mime-type seems to be a bit off).

Re:Real URL to image (0)

Anonymous Coward | more than 10 years ago | (#8845674)


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

java 3000 times slower (0, Funny)

Anonymous Coward | more than 10 years ago | (#8845552)

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

Java can be faster then C sometimes (-1, Redundant)

Face the Facts (770331) | more than 10 years ago | (#8845602)

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?

Re:Java can be faster then C sometimes (3, Informative)

Metallic Matty (579124) | more than 10 years ago | (#8845633)

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

Astounding.

Re:Java can be faster then C sometimes (-1, Troll)

Face the Facts (770331) | more than 10 years ago | (#8845656)

You are correct. I saw it several months ago and thought it was so good I saved it. Sorry, I should have given credit.

It was first written by 'AKAImBatman'; I should have given credit.

Re:Java can be faster then C sometimes (1)

Metallic Matty (579124) | more than 10 years ago | (#8845660)

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

Re:Java can be faster then C sometimes (5, Informative)

evanbd (210358) | more than 10 years ago | (#8845694)

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.

Re:Insightful my ass (2, Interesting)

francium de neobie (590783) | more than 10 years ago | (#8845739)

> 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

Re:Java can be faster then C sometimes (2, Interesting)

Anonymous Coward | more than 10 years ago | (#8845755)

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 [sun.com] , 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.

Re:Java can be faster then C sometimes (3, Informative)

Avakado (520285) | more than 10 years ago | (#8845756)

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?

old hardware (1, Funny)

cybermint (255744) | more than 10 years ago | (#8845553)

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

Re:old hardware (1)

jabbadabbadoo (599681) | more than 10 years ago | (#8845572)

And now it runs Java number crunching in the background.

Correct url for picture is (-1, Redundant)

dannycarroll (180967) | more than 10 years ago | (#8845556)

Here [cpjava.net]

Re:Correct url for picture is (-1, Flamebait)

Anonymous Coward | more than 10 years ago | (#8845685)

Thanks, asshole. I missed it two fucking posts up from yours by the author himself. Article: -1, Redundant. dannycarroll: -1, Retarded.

Java? (4, Insightful)

Kent Simon (760127) | more than 10 years ago | (#8845559)

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.

Re:Java? (2, Informative)

bishiraver (707931) | more than 10 years ago | (#8845578)

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

Re:Java? (1)

fucksl4shd0t (630000) | more than 10 years ago | (#8845725)

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

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

Oh boy... (5, Insightful)

MosesJones (55544) | more than 10 years ago | (#8845604)


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.

Re:Oh boy... (0)

Anonymous Coward | more than 10 years ago | (#8845730)

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

Re:Java? (5, Insightful)

hayds (738028) | more than 10 years ago | (#8845622)

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

Re:Java? (5, Informative)

Anonymous Coward | more than 10 years ago | (#8845679)

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 .

Slashdotted already? (-1, Offtopic)

InternationalCow (681980) | more than 10 years ago | (#8845560)

I can't seem to connect to the server. Maybe a time-warped slashdot effect (considering the freshness of the post at this time, it MUST be something like that) has caused the server to be down. Apart from that, I think participating should be fun. A client written in Java is a good idea, as the OS you use is not important in that case. Too many distributed computing projects are being hampered by having Windows-only clients.

Hi-quality pr0n (3, Funny)

Compact Dick (518888) | more than 10 years ago | (#8845561)

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.

Re:Hi-quality pr0n (0)

Anonymous Coward | more than 10 years ago | (#8845702)

smaller aperature [sic]

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

Java is a slow cruncher (-1, Flamebait)

jabbadabbadoo (599681) | more than 10 years ago | (#8845563)

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.

FP ops in Java are incredibly slow and broken [google.com] .

Re:Java is a slow cruncher (4, Insightful)

LarsWestergren (9033) | more than 10 years ago | (#8845624)

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

Re:Java is a slow cruncher (1, Insightful)

Anonymous Coward | more than 10 years ago | (#8845757)

These days, processing cycles cheap, programmer time expensive.

Are you a project manager or something? He's asking for a 'zillion' machines to run it on, so processing cycles are not quite that cheap it seems.

Re:Java is a slow cruncher (3, Insightful)

blinkie (27148) | more than 10 years ago | (#8845666)

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

Re:Java is a slow cruncher (2, Insightful)

Anonymous Coward | more than 10 years ago | (#8845754)

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.

No (0)

Anonymous Coward | more than 10 years ago | (#8845566)

It's a Java Trap.

Nah (4, Funny)

AstrumPreliator (708436) | more than 10 years ago | (#8845569)

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

Mirrored, just in case (2, Redundant)

cybermint (255744) | more than 10 years ago | (#8845570)

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 [antigamer.com]

Re:Mirrored, just in case (1, Insightful)

Anonymous Coward | more than 10 years ago | (#8845627)

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

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

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

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

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

Re:Mirrored, just in case (0)

Anonymous Coward | more than 10 years ago | (#8845667)

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

Wireless or not... (-1, Redundant)

Face the Facts (770331) | more than 10 years ago | (#8845573)

...a "cluster" of more or less randomly distributed and connected computers isn't such a bad idea.

On universities, 99% of computers run with nearly zero CPU load for most of the time. People read emails, surf the web, but for most of the time the computers idle. And then someone has some work reaoznajeszdy, waits in queue for a month, throws data on the university campus dedicated cluster, waits for results for a week and receives results that are invalid due to some mistake in input data, so whole procedure must be repeated all over.

Now imagine, we install a "cluster server" on all networked computers. Assign certain resources to the project and let our PC participate in that cluster. It loads a custom computational module for given task, loads data from some anonymous dude on the other end of the world and computes his project. Heaviest "daily" stuff gets finished within few hours. It doesn't really disturb you - works as "idle task", just like SETI@home or such. But, say, you're a raytracer. You prepare a nice animation in LightWave and would leave it overnight to render. Just upload it to the net and have it rendered in 5 minutes on the worldwide cluster. Cool, eh?

Of course the system could be abused. I think some "credit system" would be in order, so people who provide more, get better priority. Plus some way of authoring the "modules" so it couldn't be used to take over the computer. And of course this would be the first step to creating a self-conscious AI, good or evil :) But I think it would be worth a try.

Re:Wireless or not... (0)

MrLizardo (264289) | more than 10 years ago | (#8845640)

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

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

-Mr. Lizard

power consumption (4, Insightful)

lightray (215185) | more than 10 years ago | (#8845676)

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.

Re:Wireless or not... (1)

Paul Townend (185536) | more than 10 years ago | (#8845687)

This sounds similar to what some people (such as Entropia [entropia.com] ) are attempting on "The Grid" (see The Globus Project [globus.org] for more wiffly utopian detail on that).

Of course, it also leads to problems. Like security - how much can you trust an autonomous node to return correct data?

To what extent is there scope for malicious nodes deliberately returning incorrect results? And given the autonomous nature of the nodes, they can turn on and off (crash, be turned off) at any time and their performance will fluctuate depending on what other load (that you can't control) is placed on them, so you may want checkpointing and/or redundancy going on.

Which leads to the question of how to co-ordinate it all to maintain consistancy should you wish to roll back. All very app-specific, to be sure, but it's the detail that prevents stuff like this from being used by more people.

Blah!

Anonymous grid computing (4, Insightful)

mec (14700) | more than 10 years ago | (#8845693)

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.

Re:Anonymous grid computing (1)

Lehk228 (705449) | more than 10 years ago | (#8845773)

How about a system where one master server controls who gets what project on the cluster, if you use the cluster for mp3 encoding then you lose access to the cluster except for requesting manual approval of the cluster admin if you later have an actual project, just make the rules no mp3's and no re-encoding movies into XviD.

Re:Wireless or not... (1)

fucksl4shd0t (630000) | more than 10 years ago | (#8845748)

I think this is a great idea! What is needed is some not-for-profit organization to oversee the open source project and ensure that all data that goes on the network is digitally signed and encrypted, to protect the generous souls hosting nodes as much as anything else. Who would be willing to take a crack at this? It's way out of my league right now, maybe in a few years, though...

Best time is Winter (4, Funny)

DigiShaman (671371) | more than 10 years ago | (#8845579)

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.

Re:Best time is Winter (1)

Tuqui (96668) | more than 10 years ago | (#8845706)

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

Mod parent up (1)

Wellmont (737226) | more than 10 years ago | (#8845719)

I agree, right now the people who would do this either:

run SETI@home already :)

or don't really like the idea of someone else benefitting from their pipe.

It's very similar to the cable modem "hack" that can suck bandwidth out of a "cluster" of served modems...the people who would use it would tend to abuse it.

Re:Best time is Winter (2, Insightful)

Exiler (589908) | more than 10 years ago | (#8845722)

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

Re:Best time is Winter (1, Funny)

ObviousGuy (578567) | more than 10 years ago | (#8845738)

The other half of the world is in night time.

Re:Best time is Winter (1)

DigiShaman (671371) | more than 10 years ago | (#8845759)

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

Broken link, java jab (4, Informative)

Dominic_Mazzoni (125164) | more than 10 years ago | (#8845583)

The link to the image should be http://www.cpjava.net/raytraces/DRUN.GIF [cpjava.net] (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) [pfdubois.com] - 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.

Re:Broken link, java jab (5, Informative)

evanbd (210358) | more than 10 years ago | (#8845669)

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.

Numpy is great, but... (2, Informative)

XNormal (8617) | more than 10 years ago | (#8845678)

Numerical Python is great, but not necessarily suitable for this task. It's good when you're performing the same operation on the items of a vectors. When the vectors are long enough it indeed approaches the performance of C code. But in ray tracing every photon can take a different route depending on what it hits. I'm not so sure Numpy would perform nearly as well in this case.

you need to work on your java skills then... (5, Informative)

Kunta Kinte (323399) | more than 10 years ago | (#8845736)

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 [idiom.com] . He brings up " Benchmarking Java against C and Fortran for Scientific Applications [philippsen.com] 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.

Re:Broken link, java jab (1)

fucksl4shd0t (630000) | more than 10 years ago | (#8845766)

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

Re:Broken link, java jab (1)

illumen (718958) | more than 10 years ago | (#8845775)

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

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

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

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

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

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

Have fun!

Java huh? (0, Troll)

Kris_J (10111) | more than 10 years ago | (#8845585)

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

Re:Java huh? (1)

Vellmont (569020) | more than 10 years ago | (#8845664)


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


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

Re:Java huh? (0)

Anonymous Coward | more than 10 years ago | (#8845731)

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

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

Is is really useful? (1)

School_HK (757129) | more than 10 years ago | (#8845591)

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

Missing the point (0)

Anonymous Coward | more than 10 years ago | (#8845655)

He chose Java for portability, not performance.

AC

Re:Is is really useful? (0)

Anonymous Coward | more than 10 years ago | (#8845772)

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

Photons (5, Interesting)

richie2000 (159732) | more than 10 years ago | (#8845593)

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

Re:Photons (1)

ldspartan (14035) | more than 10 years ago | (#8845643)

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

--
lds

Re:Photons (5, Funny)

Kelerain (577551) | more than 10 years ago | (#8845714)

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.

Surprisingly... (1)

nfabl (748199) | more than 10 years ago | (#8845651)

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

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

Re:Photons (0)

Anonymous Coward | more than 10 years ago | (#8845665)

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

Re:Photons (5, Interesting)

Bandwidth_ (91035) | more than 10 years ago | (#8845716)

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

Re:Photons (3, Interesting)

Yarn (75) | more than 10 years ago | (#8845745)

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 [nus.edu.sg] 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!

the newest smart-virus (2, Funny)

kjba (679108) | more than 10 years ago | (#8845603)

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

I am so in on it (1)

the_thunderbird (682833) | more than 10 years ago | (#8845609)

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

Java (-1, Troll)

Junky191 (549088) | more than 10 years ago | (#8845626)

"The program is pure Java." That will just about offset the fact that the hardware is 3000 times faster. It will probably take the exact same amount of time as in 94.

Explain picture (5, Interesting)

miike (770833) | more than 10 years ago | (#8845639)

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?

Trust? (4, Insightful)

wan-fu (746576) | more than 10 years ago | (#8845641)

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?

Povray ? (1)

dargaud (518470) | more than 10 years ago | (#8845642)

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

Re:Povray ? (1)

chrispl (189217) | more than 10 years ago | (#8845691)

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

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

Trillion cycles? (1)

Moderation abuser (184013) | more than 10 years ago | (#8845645)

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

All this effort for THAT? (0)

Anonymous Coward | more than 10 years ago | (#8845650)

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

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

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

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

The value isn't in the cycles... (1)

emtechs (770821) | more than 10 years ago | (#8845652)

If he really wanted to take advantage of the audience he should publish the source code. I'm sure someone would have it running in every language you could want.

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

Photon Soup: Longer and Uncut (5, Informative)

Xenoproctologist (698865) | more than 10 years ago | (#8845661)

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

which would you rather run? (5, Insightful)

theguywhosaid (751709) | more than 10 years ago | (#8845662)

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.

Impractical (0)

Anonymous Coward | more than 10 years ago | (#8845670)

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

Personally if I were a siggraph reviewer I'd reject this submission as "impractical".

Now is the right time to publish the 1994 algorithm, and when computers get another 3000 times faster it will be the right time to publish *this* article.

This is assuming that no one can do better with less in the meanwhile, which is probably what will happen.

So this stuff is worthless now, and will probably be worthless in the future too.

Mother Goose (0)

Anonymous Coward | more than 10 years ago | (#8845672)

the .gif is slashdotted at frickin' 3:30am

Re:Mother Goose (2, Funny)

dew-genen-ny (617738) | more than 10 years ago | (#8845762)

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.

Could you please configure your server properly? (2, Informative)

francium de neobie (590783) | more than 10 years ago | (#8845673)

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.

Mod me off-topic (0, Offtopic)

Merovign (557032) | more than 10 years ago | (#8845680)


What is it with the moderators today?!?!

People are posting things like "gee this is a great idea" and getting modded as a Troll, people are
posting simple and obvious and funny jokes and being modded as Flamebait!

?

Enter applet. (4, Insightful)

Kingpin (40003) | more than 10 years ago | (#8845681)

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

3 cameras? (2, Interesting)

91degrees (207121) | more than 10 years ago | (#8845746)

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.
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?