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
Conversation
timj
commented
Feb 1, 2022
•
edited
edited
- 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.
ef7586d
to
a912881
Compare
Ha, need to update the Python version... |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.