# I translated Peter Shirley's Raytracer to Julia. C++ 1min -\> Julia 2m30s -\> 15s (@threads)

**URL:** <https://discourse.julialang.org/t/i-translated-peter-shirleys-raytracer-to-julia-c-1min-julia-2m30s-15s-threads/75671>\
**Category:** Visualization\
**Tags:** images, graphics\
**Created:** [February 2, 2022, 4:04pm UTC](https://discourse.julialang.org/t/i-translated-peter-shirleys-raytracer-to-julia-c-1min-julia-2m30s-15s-threads/75671 "2022-02-02T16:04:07Z")\
**Posts on this page:** 1\
**Showing post:** 27

<div class="post-metadata">

**Author:** ![lawless-m](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lawless-m/32/30869_2.png) [@lawless-m](https://discourse.julialang.org/u/lawless-m)\
**Post date:** [February 20, 2022, 8:32pm UTC](https://discourse.julialang.org/t/i-translated-peter-shirleys-raytracer-to-julia-c-1min-julia-2m30s-15s-threads/75671/27 "2022-02-20T20:32:01Z")

</div>

in [this thread](https://discourse.julialang.org/t/taking-ttfx-seriously-can-we-make-common-packages-faster-to-load-and-use/74949/83) some people had found reduced TTFX by removing that as a dependency. So I was experimenting with that. I don’t think it made any difference.

But it did enable me to simplify because I could add a methods for op(::Vec3, ::Float64) which broadcasts the scalar op to every member of the vec. although that’s for looks not speed 🙂

I’ve also been playing with GPU code for it, and although I haven’t got it working yet, it does look promising - testing the hits for the whole scanline in a single GPU Kernel

---

_[View the full topic](https://discourse.julialang.org/t/i-translated-peter-shirleys-raytracer-to-julia-c-1min-julia-2m30s-15s-threads/75671)._
