Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes to specialization stats. #27457

Merged
merged 2 commits into from Jul 29, 2021

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Jul 29, 2021

  • Use class, not value in fail stats for BINARY_SUBSCR. We don't care whether the subscript is 7 or 13, we care that it is an int.
  • Fix counts for unquickened instructions. We were counting ADAPTIVE instructions as unquickened as well.

@@ -3380,6 +3381,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
STAT_INC(LOAD_ATTR, deferred);
cache->adaptive.counter--;
oparg = cache->adaptive.original_oparg;
STAT_DEC(LOAD_ATTR, unquickened);
Copy link
Member

@iritkatriel iritkatriel Jul 29, 2021

Choose a reason for hiding this comment

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

We don't need this in LOAD_GLOBAL as well?

Copy link
Member

@iritkatriel iritkatriel Jul 29, 2021

Choose a reason for hiding this comment

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

These counters are uints. Is there no danger of underflow?

Copy link
Member Author

@markshannon markshannon Jul 29, 2021

Choose a reason for hiding this comment

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

Yes, thanks

Copy link
Member Author

@markshannon markshannon Jul 29, 2021

Choose a reason for hiding this comment

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

These counters are uints. Is there no danger of underflow?

Unsigned int underflow is well defined in C (unlike for signed int). So the STAT_DEC followed by the STAT_INC is a no op for all values.

@markshannon markshannon merged commit 2116909 into python:main Jul 29, 2021
12 checks passed
@markshannon markshannon deleted the tidy-up-stats branch Jan 6, 2022
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.

None yet

4 participants