Re: Faster and Safer Raytracing in Nim

2020-06-05 Thread aguspiza2
> i wanted to use Option[T] which were removed anyway because it made the code > 5x slower Doing exactly the same thing (but taking a rust port as a reference), I also had the same problem with Option[T] as return type being 3.5x slower than (bool, T) tuple on some cases but not others. :( Als

Re: Faster and Safer Raytracing in Nim

2020-05-28 Thread mratsim
> How about to use counter based random number generater like philox? > [https://www.thesalmons.org/john/random123](https://www.thesalmons.org/john/random123)/ This paper is mentioned in JAX (another Google Deep Learning framework), which was mentioned to me here [https://github.com/mratsim/wea

Re: Faster and Safer Raytracing in Nim

2020-05-28 Thread demotomohiro
How about to use counter based random number generater like philox? [https://www.thesalmons.org/john/random123](https://www.thesalmons.org/john/random123)/ It works like a hash function. When you generate a random number, you make a unique number and pass it the function. You can create unique n

Re: Faster and Safer Raytracing in Nim

2020-05-26 Thread mratsim
A weekend past and some new updates: * The raytracer is now parallelized. * I have found a parallel RNG scheme that allows reproducible multithreaded result for those who wants to do parallel reproducible Monte-Carlo simulations: * writeup [https://github.com/mratsim/weave/issues/147#iss

Re: Faster and Safer Raytracing in Nim

2020-05-22 Thread mrgaturus
Very good, this debunk an old blog article that show slowest results compared to C++

Re: Faster and Safer Raytracing in Nim

2020-05-22 Thread mratsim
I checked the schedule dynamic/static but it seems to be something else. If someone can reproduce that would be helpful. You probably need at least 4~8 cores.

Re: Faster and Safer Raytracing in Nim

2020-05-22 Thread mratsim
So the parallelization of SmallPT uses `dynamic` scheduling #pragma omp parallel for schedule(dynamic, 1) private(r) // OpenMP for (int y=0; yhttps://www.cs.brandeis.edu/~dilant/WebPage_TA160/initialsllides.pdf](https://www.cs.brandeis.edu/~dilant/WebPage_TA160/initialslli

Re: Faster and Safer Raytracing in Nim

2020-05-22 Thread Araq
Before we re-publish this as an article on our website, can you explain the 2min14.616s outlier for GCC 10 C++ OpenMP? Or can at least somebody confirm these numbers? :-)

Re: Faster and Safer Raytracing in Nim

2020-05-22 Thread zio_tom78
@mratsim, I agree with @aredirect: this repository of yours is pure gold!

Re: Faster and Safer Raytracing in Nim

2020-05-21 Thread aredirect
@mratsim it's always a pleasure to see your posts and work :) thank you

Faster and Safer Raytracing in Nim

2020-05-21 Thread mratsim
So while looking for visual examples to showcase Weave, I went a outside of my comfort zone and tried my hand at graphics programming, in particular raytracing. # Faster I was pleasantly surprised to see Nim consistently faster than C++ on single-threaded code: [SmallPT](https://www.kevinbea