Created
August 6, 2012 15:00
-
-
Save andrewbolster/3275052 to your computer and use it in GitHub Desktop.
How to make speed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Array evaluations were taking up 60% of my execution time. This is a simplified version | |
import logging, numpy | |
logging.basicConfig(level=logging.INFO) | |
x=numpy.random.rand(100,100) | |
logging.debug("This is bloody slow because of this: %s"%x) | |
# Remember, the array is evaluated BEFORE being passed to logging | |
#So, to cheat: | |
debug = False | |
if debug: logging.debug("This is bloody slow because of this: %s"%x) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment