Skip to content

Instantly share code, notes, and snippets.

@bkj
Last active January 20, 2018 20:21
Show Gist options
  • Save bkj/de234131a53a9198f05bdb7177a43643 to your computer and use it in GitHub Desktop.
Save bkj/de234131a53a9198f05bdb7177a43643 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from __future__ import print_function
import sys
import numpy as np
from time import time
if __name__ == "__main__":
np.random.seed(123)
N = int(200e6)
b = np.random.choice(N, N)
x = np.ones((2, 2))
y = (b - b)
start_time = time()
for _ in range(3):
r = x[0, :][y]
print(time() - start_time, file=sys.stderr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment