Change version detection mecanism#2802
Conversation
Kyle-Verhoog
left a comment
There was a problem hiding this comment.
@maxday @brettlangdon what are the plans for how/when the _version file will be generated?
|
|
@maxday do you have performance/profile results with this change? how much of an improvement does it make? |
@brettlangdon Yes : over 10 runs, result is the average Before : 853ms This is a massive win for our cold start duration. (Full disclosure, I had to comment the import in debug.py as well since it also imports |
Kyle-Verhoog
left a comment
There was a problem hiding this comment.
awesome! lgtm with just a tweak to the test cases
| "Programming Language :: Python :: 3.9", | ||
| ], | ||
| use_scm_version=True, | ||
| use_scm_version={"write_to": "ddtrace/_version.py"}, |
Codecov Report
@@ Coverage Diff @@
## master #2802 +/- ##
=======================================
Coverage 84.87% 84.87%
=======================================
Files 592 595 +3
Lines 43384 43421 +37
=======================================
+ Hits 36820 36855 +35
- Misses 6564 6566 +2
Continue to review full report at Codecov.
|
…:DataDog/dd-trace-py into maxday/change-version-detection-mecanism
|
I have moved tests under |
Description
pkg_resourcesis quite heavy and slows down cold start when dd-trace-py is used in a AWS Lambda environment.This PR uses the
write_tomecanism to write this version to a file (and defaulting to pkg_resources in case of an unexpected error)Checklist