Skip to content

impr: Optimized the _common_metadata function - #261

Merged
vstinner merged 2 commits into
psf:mainfrom
DebanKsahu:impr/performance
Sep 28, 2026
Merged

vstinner merged 2 commits into
psf:mainfrom
DebanKsahu:impr/performance

Conversation

@DebanKsahu

Copy link
Copy Markdown
Contributor

Description

  • Initially it was removing uncommon key and value pair then comparing the common key and value pair and if they are not equal remove them also.
  • Now it just comparing the values while not present values have default value has None but as the type of metadata values is only of type int | str | float | list[str] which doesn't contain None so with one loop it is doing both operation.

Comment thread pyperf/_metadata.py Outdated

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@vstinner
vstinner merged commit cbf4a09 into psf:main Sep 28, 2026
14 checks passed
@vstinner

Copy link
Copy Markdown
Member

Merged, thanks.

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.

2 participants