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

DM-33478: Try to speed up PropertySet on macOS ARM #73

Merged
merged 5 commits into from Feb 2, 2022
Merged

Conversation

timj
Copy link
Member

@timj timj commented Feb 1, 2022

  • Cache the type to name mapping. This mapping does not change and can be calculated once.
  • Use exists rather than triggering a double try/except catch in guessIntegerType.

This mapping does not change and can be calculated once.
People do except that if they have a PropertySet with a NaN
in it and compare it to another PropertySet that has a NaN
in the same place in the hierarchy, that they should equate.
For some reason on M1 Pro/Max the (double) try/except is
orders of magnitude slower than first checking for existence.
@ktlim
Copy link
Contributor

ktlim commented Feb 1, 2022

Ha, need to update the Python version...

@timj timj changed the title DM-33478: Cache the mapping of container fundamental type to type name DM-33478: Try to speed up PropertySet on macOS ARM Feb 1, 2022
Copy link

@erykoff erykoff left a comment

Choose a reason for hiding this comment

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

One small question.

type_obj = getattr(PropertySet, "TYPE_" + checkType)
_TYPE_MAP[type_obj] = checkType
# Store both directions.
_TYPE_MAP[checkType] = type_obj
Copy link

Choose a reason for hiding this comment

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

Just want to make sure that type_obj and checkType can never step on each other, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Mypy would have a fit but one of them is a TypeInfo object and the other is a string so they can't stomp on each other.

@timj timj merged commit 66d7acc into main Feb 2, 2022
@timj timj deleted the tickets/DM-33478 branch February 2, 2022 15:55
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.

None yet

3 participants