This repository was archived by the owner on Oct 29, 2024. It is now read-only.
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
influxdb is slow to import when pandas is present #797
Open
Description
I noticed that some commands where we're using influxdb.client
were getting slow to run. I used import-profiler to dig into it and found that it was due to importing pandas
within influxdb.dataframe_client
. I hacked together an env var to avoid this and compared:
% time env INFLUXDB_NO_DATAFRAME_CLIENT=1 python -c 'import influxdb'
real 0m0.157s
user 0m0.140s
sys 0m0.016s
% time env __INFLUXDB_NO_DATAFRAME_CLIENT=1 python -c 'import influxdb'
real 0m0.480s
user 0m0.756s
sys 0m2.196s
%
Is this something you might consider as a PR?
This is the gist of it: https://github.com/aristanetworks/influxdb-python/pull/2/files
It's just a WIP, but if you're OK with the approach, I can rebase + clean it up and submit a PR here.
Thoughts?