It's friday night. Finally back at the hotel without a meeting or party or a session to go to. What else is there to do but port benchmarks of debatable value to my favorite new non-Java language: Fan. Earlier in the I was directed to this blog post detailing some performance problems with groovy. Yes, I know the blog is old. That's not the point I want to make here. This week at Javaone, there was a presentation doing some more performance comparisons between languages on the JVM. This one caught my eye because it's the first one I've seen in the wild that included Fan. So this got me thinking about year old post and the ray tracing exercise. How would fan hold up? I decided to find out. Because there's no better way to spend a Friday night after long conference week, right? The Fan code isn't idiomatic (I'm not that bored tonight). It's just a quick and dirty port from the Java source to Fan. For reference, I reran the Java version and then the Fan version. This test is running on OS X and Java 1.6u13. Without further hand waving, here's the results:
time java -cp . ray 8 512 real 0m14.210s user 0m12.443s sys 0m1.313s time fan tracer::RayTest 8 512 real 0m17.700s user 0m15.832s sys 0m0.672s
As you can see, the performance is really quite good. I'll probably play with the source over the next few days and see if I can't improve it a bit. The fan code is pretty rough so there's probably a fair bit to be done to speed that up a bit. I'll attach the source so if anyone else is interested the source will be available. I have to say, though, that's not too shabby at all.