diff options
| author | mattip <matti.picus@gmail.com> | 2023-05-10 21:06:46 +0300 |
|---|---|---|
| committer | mattip <matti.picus@gmail.com> | 2023-05-10 21:41:48 +0300 |
| commit | 670842b38005febf64259f268332e46d86233ef0 (patch) | |
| tree | 75aefd3fd4748f89b9327a5107c18f0f369138d7 /benchmarks | |
| parent | 181c15b294d6dd164e4c41ddbb1c5feae9b5beee (diff) | |
| download | numpy-670842b38005febf64259f268332e46d86233ef0.tar.gz | |
add fast path for str(scalar_int)
Diffstat (limited to 'benchmarks')
| -rw-r--r-- | benchmarks/benchmarks/bench_scalar.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/benchmarks/benchmarks/bench_scalar.py b/benchmarks/benchmarks/bench_scalar.py index 650daa89d..d68f934cb 100644 --- a/benchmarks/benchmarks/bench_scalar.py +++ b/benchmarks/benchmarks/bench_scalar.py @@ -65,3 +65,13 @@ class ScalarMath(Benchmark): other + int32 other + int32 other + int32 + +class ScalarStr(Benchmark): + # Test scalar to str conversion + params = [TYPES1] + param_names = ["type"] + def setup(self, typename): + self.a = np.array([100] * 100, dtype=typename) + + def time_str_repr(self, typename): + res = [str(x) for x in self.a] |
