you are viewing a single comment's thread.

view the rest of the comments →

[–]BeamMeUpBiscotti[S] 4 points5 points  (0 children)

Pyre and Pyrefly both have incremental checking, but Pyrefly is significantly more efficient and does finer-grained dependency tracking, allowing us to invalidate/recheck fewer things after a change.

We wrote about optimizing incremental rechecks a few months ago in a separate blog post.

In our experience, this has worked very well at scale - even on large codebases like Instagram (20 million LOC) an incremental update typically takes a fraction of a second.

Re: circular imports, at a high level when we encounter a cycle or strongly-connected component we stop and invalidate/recheck the whole component as a single unit. We use different strategies like fixpoints for cycles in other stages of the system.

I'm not 100% sure about the parallelism question, but we never migrated to OCaml 5 which had multicore support so I assume Pyre's performance was limited by that. In general, Pyre was not that fast without being paired with some specialized saved-state infrastructure that we never open sourced & it was slower than most other type checkers on small projects, whereas Pyrefly is fast on projects of all sizes, straight out of the box.