Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Tools/ftscalingbench/ftscalingbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,16 @@ def object_cfunction():

@register_benchmark
def cmodule_function():
N = 1000 * WORK_SCALE
for i in range(N):
math.cos(i / N)

@register_benchmark
def object_lookup_special():
# round() uses `_PyObject_LookupSpecial()` internally.
N = 1000 * WORK_SCALE
for i in range(1000 * WORK_SCALE):
math.floor(i * i)
round(i / N)

@register_benchmark
def mult_constant():
Expand Down Expand Up @@ -206,7 +214,7 @@ def benchmark(func):
color = "\x1b[33m" # yellow
reset_color = "\x1b[0m"

print(f"{color}{func.__name__:<18} {round(factor, 1):>4}x {direction}{reset_color}")
print(f"{color}{func.__name__:<25} {round(factor, 1):>4}x {direction}{reset_color}")

def determine_num_threads_and_affinity():
if sys.platform != "linux":
Expand Down
Loading