Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-125985: Fix cmodule_function() scaling benchmark#128460

Merged
colesbury merged 2 commits intopython:mainpython/cpython:mainfrom
colesbury:gh-125985-scaling-benchcolesbury/cpython:gh-125985-scaling-benchCopy head branch name to clipboard
Jan 3, 2025
Merged

gh-125985: Fix cmodule_function() scaling benchmark#128460
colesbury merged 2 commits intopython:mainpython/cpython:mainfrom
colesbury:gh-125985-scaling-benchcolesbury/cpython:gh-125985-scaling-benchCopy head branch name to clipboard

Conversation

@colesbury
Copy link
Contributor

@colesbury colesbury commented Jan 3, 2025

Add a separate benchmark that measures the effect of _PyObject_LookupSpecial() on scaling.

In the process of cleaning up the scaling benchmarks for inclusion, I unintentionally changed the cmodule_function benchmark to pass an int to math.floor(), which causes it to use the _PyObject_LookupSpecial() code path. _PyObject_LookupSpecial() has its own scaling issues that we want to measure separately.

Add a separate benchmark that measures the effect of
`_PyObject_LookupSpecial()` on scaling.

In the process of cleaning up the scaling benchmarks for inclusion, I
unintentionally changed the "cmodule_function" benchmark to pass an
`int` to `math.floor()` instead of a `float`, which causes it to use the
`_PyObject_LookupSpecial()` code path. `_PyObject_LookupSpecial()` has
its own scaling issues that we want to measure separately from calling a
function on a C module.
@colesbury
Copy link
Contributor Author

When combined with #128164:

  • cmodule_function now scales well (14.9x faster)
  • object_lookup_special demonstrates the issue with _PyObject_LookupSpecial (1.3x slower)

Copy link
Contributor

@mpage mpage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Tools/ftscalingbench/ftscalingbench.py Outdated Show resolved Hide resolved
Co-authored-by: mpage <mpage@cs.stanford.edu>
@colesbury colesbury enabled auto-merge (squash) January 3, 2025 21:26
@colesbury colesbury merged commit f157485 into python:main Jan 3, 2025
35 of 36 checks passed
WolframAlph pushed a commit to WolframAlph/cpython that referenced this pull request Jan 4, 2025
…28460)

Add a separate benchmark that measures the effect of
`_PyObject_LookupSpecial()` on scaling.

In the process of cleaning up the scaling benchmarks for inclusion, I
unintentionally changed the "cmodule_function" benchmark to pass an
`int` to `math.floor()` instead of a `float`, which causes it to use the
`_PyObject_LookupSpecial()` code path. `_PyObject_LookupSpecial()` has
its own scaling issues that we want to measure separately from calling a
function on a C module.
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
…28460)

Add a separate benchmark that measures the effect of
`_PyObject_LookupSpecial()` on scaling.

In the process of cleaning up the scaling benchmarks for inclusion, I
unintentionally changed the "cmodule_function" benchmark to pass an
`int` to `math.floor()` instead of a `float`, which causes it to use the
`_PyObject_LookupSpecial()` code path. `_PyObject_LookupSpecial()` has
its own scaling issues that we want to measure separately from calling a
function on a C module.
@colesbury colesbury deleted the gh-125985-scaling-bench branch February 28, 2025 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.