1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
#### ur_optimize ####
### General Information ###
Base installation medium: Ureka_linux-rhe5_64_1.4.1.tar.gz
## SYSTEM ##
```
Manufacturer: Dell Inc.
Product Name: OptiPlex 790
```
## BIOS ##
```
Vendor: Dell Inc.
Version: A07
Release Date: 09/10/2011
```
## CPU ##
```
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
stepping : 7
microcode : 0x29
cpu MHz : 3399.867
cache size : 8192 KB
physical id : 0
siblings : 8
core id : 3
cpu cores : 4
```
## MEMORY INFORMATION ##
```
size : 16GB
type : DDR3
Mhz : 1333
```
### test_linalg.py module ###
```
#!/usr/bin/env python
import numpy
import scipy.interpolate
def interpolate(user_methods=None, points=1000):
x = numpy.linspace(1.0, 1000.0, num=points)
y = numpy.linspace(1.0, 1000.0, num=points)
methods = ['linear', 'nearest', 'zero', 'slinear', 'quadratic', 'cubic']
if user_methods is not None:
methods = user_methods
for method in methods:
print("{}...".format(method)),
try:
scipy.interpolate.interp1d(x, y, kind=method, bounds_error=False, fill_value=0.0)
except MemoryError:
# Common ocurrance with quadratic
print("failed")
print("ok")
if __name__ == "__main__":
interpolate()
```
### Performance Comparison ###
## Before ur_optimize ##
```
$ ipython
Python 2.7.5 (default, Jun 19 2014, 11:22:38)
Type "copyright", "credits" or "license" for more information.
IPython 2.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import test_linalg
In [2]: %timeit test_linalg.interpolate(['quadratic'])
quadratic... ok
quadratic... ok
quadratic... ok
quadratic... ok
1 loops, best of 3: 39 s per loop
```
## After ur_optimize ##
```
$ ipython
Python 2.7.5 (default, Jun 19 2014, 11:22:38)
Type "copyright", "credits" or "license" for more information.
IPython 2.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import test_linalg
In [2]: %timeit test_linalg.interpolate(['quadratic'])
quadratic... ok
quadratic... ok
quadratic... ok
quadratic... ok
1 loops, best of 3: 1.17 s per loop
```
|