Closed JamieMagee closed 3 years ago
@JamieMagee are you working on a fix?
@nishakm Unfortunately I haven't got time right now to properly investigate and test a fix, but I was looking at this as a starting point:
prop_decorators = r'^__|^_'
for key in obj.__dict__.keys():
# remove private and protected decorator characters if any
priv_name = '_' + obj.__class__.__name__
prop_name = re.sub(priv_name, '', key)
prop_name = re.sub(prop_decorators, '', prop_name, 1)
yield key, prop_name
to
for key in obj.__dict__.keys():
prop_name = key.split('__')[-1]
yield key, prop_name
@JamieMagee no worries. I can take a look.
Looks to me like to_dict()
is called way too many times with update_master_list
. Let me try looking at that first.
Describe the bug When running tern against
postgres:latest
approximately 85% of the runtime is spent inupdate_master_list
and approximately 60% of that function (and 50% of total runtime) is spent compiling and running regexes inprop_names
.I've attached profiler logs for more information
To Reproduce Steps to reproduce the behavior:
tern --driver fuse --clear-cache report --docker-image postgres:latest
Profiler logs generated using
Expected behavior Better performance
Environment you are running Tern on Enter all that apply
Please attach files if they exist