Skip to content

Instantly share code, notes, and snippets.

View jllanfranchi's full-sized avatar

Justin Lanfranchi jllanfranchi

  • Frequency Electronics, Inc.
View GitHub Profile
@jllanfranchi
jllanfranchi / raytracing.py
Last active May 31, 2018 13:25 — forked from michaelaye/raytracing.py
Numba optimized raytracing. From 23 sec to 9 sec to 0.45 s.
#!/usr/bin/env python
"""
For 400 x 300
Disabling Numba (i.e. Python looping, NOT numpy optimized) speed is 28.6 sec
Enabling Numba is 0.45 sec (further optimizations including removing some function calls gets this down to 0.23 sec)
Note that a Numpy version rt3.py at http://www.excamera.com/sphinx/article-ray.html is still fastest at ~0.11 sec.
Note that I have removed the checker pattern from the original code
"""
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Add files or directories to the blacklist. They should be base names, not
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.