Skip to content

gh-114682: Improve performance of module state access in _decimal #115401

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

Closed
wants to merge 3 commits into from
Closed

gh-114682: Improve performance of module state access in _decimal #115401

wants to merge 3 commits into from

Conversation

neonene
Copy link
Contributor

@neonene neonene commented Feb 13, 2024

  • Fix the module state access in ieee_context().
  • Optimize get_module_state_by_def(), which *_richcompare() now switch to.
  • Optimize find_state_left_or_right().
  • Make Context objects carry decimal_state.

@neonene
Copy link
Contributor Author

neonene commented Feb 17, 2024

Around 18% recovery with na+8 and da+32 in the pi test for me, which is no slower than the global state access. About 14% with 8+na and 32+da. FYI,

  • Carrying a module state by the Decimal object seems not to be faster even if dec_richcompare() is boosted.

  • SignalDictMixin type has non-NULL ht_module, unlike SignalDict subtype. get_module_state_by_def(tp_base) or _PyType_GetModuleState(tp_base) can be used in signaldict_*().

@neonene neonene closed this Mar 12, 2024
@neonene neonene deleted the mstate branch March 12, 2024 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant