forked from VimPlug/jedi
cache compiled.CompiledObject.defined_names attribute, improves test suite performance by 20%, numpy by more than 50%. Awesome!
This commit is contained in:
@@ -80,6 +80,9 @@ class LazyName(helpers.FakeName):
|
||||
mod)
|
||||
|
||||
module = compiled.CompiledObject(raw_module)
|
||||
if raw_module == builtins:
|
||||
# The builtins module is special and always cached.
|
||||
module = compiled.builtin
|
||||
return compiled.create(self._evaluator, self._value, module, module)
|
||||
|
||||
@parent.setter
|
||||
|
||||
@@ -82,6 +82,7 @@ class CompiledObject(Base):
|
||||
return CompiledObject(c, self.parent)
|
||||
return self
|
||||
|
||||
@underscore_memoization
|
||||
def get_defined_names(self):
|
||||
names = []
|
||||
cls = self._cls()
|
||||
|
||||
@@ -86,7 +86,6 @@ class GeneratorMethod(object):
|
||||
return self._generator.iter_content()
|
||||
|
||||
def __getattr__(self, name):
|
||||
print(self, name)
|
||||
return getattr(self._builtin_func, name)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user