Skip to content

gh-102213: Optimize the performance of __getattr__ - #103761

Merged
Fidget-Spinner merged 8 commits into
python:mainfrom
sunmy2019:gh-102248-corrected
May 1, 2023
Merged

Fidget-Spinner merged 8 commits into
python:mainfrom
sunmy2019:gh-102248-corrected

Conversation

@sunmy2019

@sunmy2019 sunmy2019 commented Apr 24, 2023 •

Copy link
Copy Markdown
Member

This is the logically corrected version of GH-102248.

GH-102248 caused several issues and had been reverted. This PR (I think) correctly implements it.

Tests passed on Ubuntu 22.04 (WSL) gcc-11 with --pydebug.

I also do the perf tests in the original PR, (--enable-optimizations with my AMD 5900X)
Before,

Python version of 3.12.0a7+ (heads/gh-102248-corrected:af53046995, Apr 24 2023, 22:42:22) [GCC 11.3.0]
Call __getattr__ spend time: 0.2576024532318115

After,

Python version of 3.12.0a7+ (heads/gh-102248-corrected:ac81fd6c7e, Apr 24 2023, 22:39:39) [GCC 11.3.0]
Call __getattr__ spend time: 0.04635906219482422

cc: @Fidget-Spinner

Loading
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.

8 participants