(fn)
| 47 | NA = ['round', 'normalize', 'cmp'] # no faithful mpmath analog |
| 48 | |
| 49 | def once(fn): |
| 50 | for i in range(50): |
| 51 | fn(i & MASK) # warm |
| 52 | n = 0 |
| 53 | t0 = time.perf_counter() |
| 54 | while True: |
| 55 | fn(n & MASK) |
| 56 | n += 1 |
| 57 | if (n & 31) == 0 and time.perf_counter() - t0 >= budget_s: |
| 58 | break |
| 59 | return (time.perf_counter() - t0) / n * 1e9 # ns/op |
| 60 | |
| 61 | rows = [] |
| 62 | for op, fn in OPS.items(): |
no test coverage detected