Replies: 1 comment 3 replies
-
How long does it take to perform a complete type analysis of the same source base, and where is the time spent during that analysis? You can use the command-line version of pyright along with the It sounds like identifying reference ranges is the most expensive part. Are you using the existing reference API for this (the "reportReferencesForPosition" method)? This method was designed for finding all of the references for a single symbol. It was not designed to find all references to all symbols in a code base. Using it to find all references to all symbols will result in an n^2 behavior or worse. You would need to implement this a different way — one in which you find all references for all symbols in a single pass — to make it efficient. |
Beta Was this translation helpful? Give feedback.
-
Following on from #1914 on using Pyright as a backend for emitting LSIF data.
Currently I am collecting definition ranges, reference ranges, and hover text using the first APIs that seemed relevant to me and worked at the time.
For a relatively small sized Python codebase:
Naturally, this does not scale well with codebase size (running on the mypy repository, it ran for 15min before I cancelled it prematurely). While extracting definition ranges and hover text can be somewhat merged together as they take very similar codepaths, references ranges dominates the execution time by a wide margin.
Leading from this, I have the following questions:
worker_threads
etc)?There are other routes we may explore (using a symbol based intermediary format cached between runs to minimize the number of files that need to be reindexed etc), but I would like to see how far we can go with Pyright itself before resorting to more elaborate solutions 🙂
Beta Was this translation helpful? Give feedback.
All reactions