Re: Optimizing a raytracer

2014-03-26 Thread Róbert László Páli
Thanks! I already do tracing the samples parallel. Strangly I have a core 2 duo and it seems that using 3 threads is the best (slightly better than 2). Aldough this might be accidetal. Maybe the more-complex samples are more equally in separate threds.

Re: Optimizing a raytracer

2014-03-26 Thread Bienlein
You can also achieve significant speed-ups by doing things in parallel, f.ex. see https://groups.google.com/forum/?hl=de#!searchin/golang-nuts/ray$20tracer/golang-nuts/mxYzHQSV3rw/dOA78aeVLgEJ

Re: Optimizing a raytracer

2014-03-26 Thread Róbert László Páli
Using a double4 could improve the performance of your code, but it must be used wisely. (One general tip is to avoid mixing SIMD and serial code. if you want to use SIMD code, then it's often better to keep using SIMD registers even if you have one value). I sadly could not get it to work

Re: Optimizing a raytracer

2014-03-26 Thread Róbert László Páli
Oh, thanks for all of your help. Nice to see, that D guys do really help. :)

Re: Optimizing a raytracer

2013-10-17 Thread bearophile
Róbert László Páli: And would you suggest to try to use SIMD double4 for 3D vectors? It would take some time to change code. Using a double4 could improve the performance of your code, but it must be used wisely. (One general tip is to avoid mixing SIMD and serial code. if you want to use SI

Re: Optimizing a raytracer

2013-10-17 Thread Róbert László Páli
@Jacob Carlborg I would say use structs. For compiler I would go with LDC or GDC. Both of these are faster for floating point calculations than DMD. You can always benchmark. Thank you for the advice! I installed ldc and used ldmd2. Te benchmarks are amazing! :O DMD > compile = 2503 > run = 2

Re: Optimizing a raytracer

2013-10-16 Thread ponce
On Wednesday, 16 October 2013 at 12:02:15 UTC, Róbert László Páli wrote: I thought, using classes may require too much memory, because they are not destructed on scope end, and maybe speed reduction when GC kicks in. Is my assumptions that in this case struct are more wise? Yes, by all means

Re: Optimizing a raytracer

2013-10-16 Thread finalpatch
I find it critical to ensure all loops are unrolled in basic vector ops (copy/arithmathc/dot etc.) On Wednesday, 16 October 2013 at 12:02:15 UTC, Róbert László Páli wrote: Hello! I am writing an unbiased raytrace renderer in D. I have good progress, but I want to make it as fast as possible

Re: Optimizing a raytracer

2013-10-16 Thread Jacob Carlborg
On 2013-10-16 14:02, "Róbert László Páli" wrote: Hello! I am writing an unbiased raytrace renderer in D. I have good progress, but I want to make it as fast as possible where I can do it without compromises. I use a struct with three doubles for vector and color calculations and I have operator

Optimizing a raytracer

2013-10-16 Thread Róbert László Páli
Hello! I am writing an unbiased raytrace renderer in D. I have good progress, but I want to make it as fast as possible where I can do it without compromises. I use a struct with three doubles for vector and color calculations and I have operator overloading for them. Many vectors and color