-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspeed_record
More file actions
14 lines (12 loc) · 875 Bytes
/
speed_record
File metadata and controls
14 lines (12 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
>>> timeit.timeit("import numpy as np;a = np.arange(100).reshape(10,10);b=a+1; c=b*2; d=a.dot(b)-c;e=2/3*c+d; a -= e.astype(np.int64)")
10.873965595622394
>>> timeit.timeit("import numpy as np;a = np.arange(100).reshape(10,10);b=a+1;a -= (2/3*b*2+a.dot(b)-b*2).astype(np.int64)")
12.733711163920816
>>> timeit.timeit("import numpy as np;a = np.arange(100).reshape(10,10);b=a+1;e= (2/3*b*2+a.dot(b)-b*2).astype(np.int64);a-=e")
12.88294753529317
>>> timeit.timeit("import numpy as np;a = np.arange(100).reshape(10,10);b=a+1;e= (2/3*b*2+a.dot(b)-b*2).astype(np.int64);a=a-e")
12.48272825253116
>>> timeit.timeit('import numpy as np;a = np.arange(1000).reshape(10,10,10);b = a[:,:,np.newaxis,:];c=b*3;d=b/4.5')
7.230386016381999
>>> timeit.timeit('import numpy as np;a = np.arange(1000).reshape(10,10,10);c = a[:,:,np.newaxis,:]*3;d=a[:,:,np.newaxis,:]/4.5')
7.658931475789359