I wrote a Julia version, now 1mins C++ (was 9min when I orig. posted) vs 2m30 (single-threaded) to 15s (multi-threaded) #987
                  
                    
                      lawless-m
                    
                  
                
                  started this conversation in
                Show and tell
              
            Replies: 2 comments 2 replies
-
| Don't forget to add it to the list: https://github.com/RayTracing/raytracing.github.io/wiki/Implementations | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            -
| I should add that it turns out I was running the C++ with poor compiler flags - I've since used -march=native and -O 3 and the C++ code runs in under a minute. | 
Beta Was this translation helpful? Give feedback.
                  
                    2 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I bought the first two books a few years ago and having learned quite a bit of Julia in the meantime, I thought I would do a translation. There are no tricks, just a straight copy of the C++ code into Julia.
My Julia code is here https://github.com/lawless-m/raytracing.github.io/tree/master/Julia
This is just the Week One code, so just the random spheres
On my machine the C++ version
The Julia version, single threaded
And the multi-threaded version, with each thread doing a different scanline and I am lucky enough to have a 40 core machine and it completes in a nice 15s
I'm looking forward to adding the next books in due course.
Beta Was this translation helpful? Give feedback.
All reactions