forked from Bears-R-Us/arkouda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathno_op_benchmark.py
33 lines (26 loc) · 1.23 KB
/
no_op_benchmark.py
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
import arkouda as ak
import numpy as np
import pytest
SECONDS = pytest.trials
@pytest.mark.benchmark(group="Arkouda_No_Op",
max_time=SECONDS
)
def bench_ak_noop(benchmark):
benchmark(ak.client._no_op)
benchmark.extra_info["description"] = \
"Measures the performance of ak.client._no_op for a basic round-trip time"
benchmark.extra_info["problem_size"] = "N/A"
benchmark.extra_info["transfer_rate"] = f"{benchmark.stats['rounds'] / benchmark.stats['total']:.4f} " \
f"operations per second"
@pytest.mark.benchmark(group="Arkouda_No_Op",
max_time=SECONDS
)
def bench_np_noop(benchmark):
if pytest.numpy:
benchmark(np.get_include)
benchmark.extra_info["description"] = \
"Measures the performance of np.get_include for a basic round-trip time comparison" \
"with ak.client._no_op"
benchmark.extra_info["problem_size"] = "N/A"
benchmark.extra_info["transfer_rate"] = f"{benchmark.stats['rounds'] / benchmark.stats['total']:.4f} " \
f"operations per second"