Newsgroups: comp.graphics.rendering.raytracing
From: tbp...@gmail.com
Date: 9 May 2005 10:51:28 -0700
Local: Mon 9 May 2005 18:51
Subject: Re: Mini ray tracer
Jon Harrop wrote: Is that comparison supposed to be fair in any way whatsoever? > I then cut this program down to a 66-line OCaml program and ported it into a > 97-line C++ program. These programs are compared on this page: > http://www.ffconsultancy.com/free/ray_tracer/comparison.html Somewhere on an opteron 146 running debian64: real 0m13.959s # objdump -x ray > inline Vec operator+(const Vec &a, const Vec &b) { return Vec(a.x + > inline Vec operator-(const Vec &a, const Vec &b) { return Vec(a.x - b.x, a.y - b.y, a.z - b.z); } > inline Vec operator*(const double a, const Vec &b) { return Vec(a * b.x, a * b.y, a * b.z); } > inline double dot(const Vec &a, const Vec &b) { return a.x*b.x + a.y*b.y + a.z*b.z; } > inline Vec unitise(const Vec &a) { return (1 / sqrt(dot(a, a))) * a; # g++ -g -O3 ray.cpp -o ray } # time ./ray >tt real 0m10.493s If your point was to show how to write unbelievably inneficient code in You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||