I think there may be 2 problems causing this:
1. Too much reference-parsing enters the "fuzzy search" mode when finding a matching object. For example, resolving a declaration ":type arg: int" will enter fuzzy search mode. However, I think from the code of a related method “domain.python.parse_reftarget” [link], only when “reftarget” startswith ".", it should enter the "fuzzy search" mode in ` find_obj`.
I added a UT to test_domain_py on my fork repo [link]. we can see when parsing a variable type of int, a 'refspecific' attribute is appended to the “pending_xref “node, and it will enter the “fuzzy search” mode, when the package is bigger, it’s costing a lot of time.
The UT to parse variable declaration with `int` type:
“pending_xref” node in the parsed doctree, it has “refspecific” attribute.
Then “find_obj” method will enter fuzzy mode.
Thanks!