Mathematica 7 compares to other languages

Jon Harrop jon at ffconsultancy.com
Mon Dec 8 20:00:35 EST 2008


jason-sage at creativetrax.com wrote:
> For the interested, with MMA 6, on a Pentium 4 3.8Ghz:
> 
> The code that Jon posted:
> 
> Timing[Export["image-jon.pgm", Graphics at Raster@Main[2, 100, 4]]]
> {80.565, "image-jon.pgm"}

That is not the code I posted: you are using Xah's parameters that generate
a different (and largely empty) scene.

> The code that Xah posted:
> 
> Timing[Export["image-xah.pgm", Graphics at Raster@Main[2, 100, 4.]]]
> {42.3186, "image-xah.pgm"}
> 
> So Xah's code is about twice as fast as Jon's code, on my computer.
> 
> The resulting files were identical (and both looked like pure white
> images; I thought they'd be interesting!).

Use 9, 512, 4 instead of 2, 100, 4 and you will get a more interesting image
of over 80,000 spheres with shadows and diffuse lighting.

This is a really important difference: half of that program is dedicated to
hierarchical spherical bounding volumes that are essential when tracing a
large number of spheres. Xah solved a completely different problem by
simplifying the scene to only 5 spheres, where bounding volumes are useless
and the performance characteristics of the program are wildly different.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?u



More information about the Python-list mailing list