Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't search for the
extends
relation on functions in Python
Summary: The current implementation of this is a manuall search to great depth and is extremely expensive. from D45096125 So much so it breaks CodeHub API Docs and the `describe()` method in glass having O(1) properties for finding parents. The extends relation has to be a lookup at depth 1. If it isn't, re-index the content until it is. Removing this branch now so that things aren't borked. Note: I'm not removing the ability to find python overrides in general, just the use of this in the `extends` relation in search related, which specifically expects it to be O(1) at depth =1 (i.e. limit=1 from glass). that's used in Glass::describe() which has to be very cheap. I suspect this is behind the long lurking comments that Python API pages don't load: the extends relation for both child and parent often run to 15s _per method_ https://fburl.com/scuba/glean_server/lc0k4idz Main issue: 8s to fail to find a method override: ``` fbsource.fbcode.python> F = python.FunctionDeclaration { name = "libfb.py.fb_record.model.Model.is_sharded" }; python.MethodOverriden { base = F } 0 results, 0 facts, 8423.35ms, 8138216 bytes, 25489 compiled bytes Facts searched: python.NameToSName.4 : 269056 python.SName.4 : 269055 python.Contains.4 : 1993 python.BaseClassToDerived.4 : 1630 python.FunctionDeclaration.4 : 1 python.FunctionDefinition.4 : 1 python.Name.4 : 1 ``` FOR NOW: disable this. Come back with a function -> function lookup table for it. Reviewed By: pepeiborra Differential Revision: D62227257 fbshipit-source-id: 46054210dddeba55397dc3933ccfeef184601e7d
- Loading branch information