Created
January 7, 2014 16:25
-
-
Save johntyree/8301919 to your computer and use it in GitHub Desktop.
Memory profile of numpy array access
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
# GistID: 8301919 | |
import numpy as np | |
import gc | |
from memory_profiler import profile | |
n = 30 | |
m = 1000000 | |
@profile | |
def main(): | |
foo = np.zeros((n, m)) | |
foo.sum() | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment