8000 BENCH: Moved benchmarks for fast paths (#17970) · numpy/numpy@af51386 · GitHub
[go: up one dir, main page]

Skip to content

Commit af51386

Browse files
committed
BENCH: Moved benchmarks for fast paths (#17970)
1 parent 9c5d414 commit af51386

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

benchmarks/benchmarks/bench_scalar.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from random import randint
12
from .common import Benchmark, TYPES1
23

34
import numpy as np
@@ -31,3 +32,6 @@ def time_abs(self, typename):
3132
n = self.num
3233
res = abs(abs(abs(abs(abs(abs(abs(abs(abs(abs(n))))))))))
3334

35+
def time_compare(self, typename):
36+
n = self.num
37+
res = [n == randint(-128, 127) for _ in range(10)]

benchmarks/benchmarks/bench_ufunc.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,21 +150,6 @@ def time_floor_divide_int(self, dtpye, divisor):
150150
self.x // divisor
151151

152152

153-
class CustomScalarEqual(Benchmark):
154-
params = (
155-
[np.int8, np.int16, np.int32, np.int64,
156-
np.uint8, np.uint16, np.uint32, np.uint64,
157-
np.float32, np.float64])
158-
param_names = ['dtype']
159-
160-
def setup(self, dtype):
161-
self.scalar_x = dtype(np.random.randint(-128, 127))
162-
self.scalar_y = np.random.randint(-128, 127)
163-
164-
def time_scalar_equality(self, dtype):
165-
for i in range(10**6):
166-
self.scalar_x == self.scalar_y
167-
168153
class Scalar(Benchmark):
169154
def setup(self):
170155
self.x = np.asarray(1.0)

0 commit comments

Comments
 (0)
0