summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/benchmarks/bench_core.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/benchmarks/benchmarks/bench_core.py b/benchmarks/benchmarks/bench_core.py
index 060d0f7db..0c2a18c15 100644
--- a/benchmarks/benchmarks/bench_core.py
+++ b/benchmarks/benchmarks/bench_core.py
@@ -7,9 +7,13 @@ class Core(Benchmark):
def setup(self):
self.l100 = range(100)
self.l50 = range(50)
+ self.float_l1000 = [float(i) for i in range(1000)]
+ self.float64_l1000 = [np.float64(i) for i in range(1000)]
+ self.int_l1000 = list(range(1000))
self.l = [np.arange(1000), np.arange(1000)]
self.l_view = [memoryview(a) for a in self.l]
self.l10x10 = np.ones((10, 10))
+ self.float64_dtype = np.dtype(np.float64)
def time_array_1(self):
np.array(1)
@@ -23,6 +27,18 @@ class Core(Benchmark):
def time_array_l100(self):
np.array(self.l100)
+ def time_array_float_l1000(self):
+ np.array(self.float_l1000)
+
+ def time_array_float_l1000_dtype(self):
+ np.array(self.float_l1000, dtype=self.float64_dtype)
+
+ def time_array_float64_l1000(self):
+ np.array(self.float64_l1000)
+
+ def time_array_int_l1000(self):
+ np.array(self.int_l1000)
+
def time_array_l(self):
np.array(self.l)