3 ms·
Have you tried passing everything by value? That is, instead of: bool hit_sphere(const struct sphere* sp, const struct ray* ray, struct hit* hit) you writ
by bjourne 8y ago
Have you tried passing everything by value? That is, instead of:
bool hit_sphere(const struct sphere* sp, const struct ray* ray, struct hit* hit)
you write:
static bool
hit_sphere(struct sphere sp, struct ray ray, struct hit hit)
IME, clang is insanely good at optimizing pass by value calls.
- hackerpacker 8y agofwiw, I took a stab at replacing a bunch of => with . and ran it: time ./crb-vec-omp real 0m0.764s which is more than twice as fast as the rust example, but it didn't create the right output... if you get bored would you mind taking a stab at adding parallel and modifying crb-vec.c https://github.com/niofis/raybench https://github.com/niofis/raybench , I definitely think you might be on to something here.