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: Use type hinting when converting to PropertySet #67

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

timj
Copy link
Member

@timj timj commented Feb 1, 2022

There can be a large slowdown in PropertySet creation if PropertySet.set() is called without a type being specified. The Configs know the types of their fields so use those types explicitly.

Problematically, the integer type must still be guessed and therefore should either reimplement the guessing code (without the isinstance check because we know it's an int and we know the field doesn't exist) or call ps.set() explicitly -- this defeats the entire purpose of the optimization. Problematically ps.getAsInt() raises when getting a small integer from a long long entry in the container. Rewriting the C++ code to use ps.getAsInt64() could work but is likely not worth it (there are about 15 calls to fix).

@timj timj force-pushed the tickets/DM-33478 branch from a17b8cb to 4202089 Compare February 1, 2022 22:46
@codecov
Copy link

codecov bot commented Feb 1, 2022

Codecov Report

Attention: Patch coverage is 2.38095% with 41 lines in your changes missing coverage. Please review.

Project coverage is 85.22%. Comparing base (c99c83e) to head (4ace2ab).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
python/lsst/pex/config/convert.py 2.70% 36 Missing ⚠️
tests/test_Config.py 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #67      +/-   ##
==========================================
- Coverage   86.11%   85.22%   -0.89%     
==========================================
  Files          46       46              
  Lines        3645     3683      +38     
==========================================
  Hits         3139     3139              
- Misses        506      544      +38     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@timj timj force-pushed the tickets/DM-33478 branch from cdc85f2 to ceedc50 Compare June 16, 2022 23:16
timj added 2 commits February 11, 2025 05:55
There can be a large slowdown in PropertySet creation if
PropertySet.set() is called without a type being specified.
The Configs know the types of their fields so use those
types explicitly.

For integer types always use LongLong.
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