Open baraklevy20 opened 11 months ago
Thanks for bringing this to our attention, @baraklevy20. We'll look into it.
cc @P403n1x87
@emmettbutler @baraklevy20
We've had this issue in production on some AWS Lambdas
Using these old dependencies:
pymysql==1.1.0 # latest
datadog_lambda==3.56.0 # pulls ddtrace==0.59.2
Extremely fast results:
python app.py
pymysql import time: 0.00000095367431640625
Using latest:
pymysql==1.1.0 # latest
datadog_lambda==5.92.0 # latest - pulls ddtrace 2.8.0
Extremely slow (by comparison):
python app.py
pymysql import time: 0.02929711341857910
cc @duncanista
Any updates on this issue? Still seems to be affecting pymysql connections.
Summary of problem
It seems like patching
pymysql
in version 2.3.1 takes a lot longer now.Example code:
Running this on any version >= 1.19.0 (I'm using 2.3.1) shows:
Running this on version 1.18.8 shows:
If it helps, it seems like
imported_module = importlib.import_module(path)
inddtrace/_monkey.py
is taking 0.4s now.I'm using short-lived instrumented processes so this additional load time adds up quickly. Would appreciate any help here. Thank you!
Which version of dd-trace-py are you using?
2.3.1
Which version of pip are you using?
23.3.1
Which libraries and their versions are you using?
pymysql==1.1.0
`pip freeze`
How can we reproduce your problem?
What is the result that you get?
Slow performance.
What is the result that you expected?
Much faster performance.