Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc-search: optimize unifyFunctionTypes #118024

Merged
merged 4 commits into from
Nov 19, 2023

Commits on Nov 18, 2023

  1. rustdoc-search: less new Maps in unifyFunctionType

    This is a major source of expense on generic queries,
    and this commit reduces them.
    
    Profile output:
    https://notriddle.com/rustdoc-html-demo-5/profile-2/index.html
    notriddle committed Nov 18, 2023
    Configuration menu
    Copy the full SHA
    6d59452 View commit details
    Browse the repository at this point in the history
  2. rustdoc-search: fast path for 1-query unification

    Short queries, in addition to being common, are also the base
    case for a lot of more complicated queries. We can avoid
    most of the backtracking data structures, and use simple
    recursive matching instead, by special casing them.
    
    Profile output:
    https://notriddle.com/rustdoc-html-demo-5/profile-3/index.html
    notriddle committed Nov 18, 2023
    Configuration menu
    Copy the full SHA
    c76c2e7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a66972d View commit details
    Browse the repository at this point in the history
  4. rustdoc-search: switch to recursive backtracking

    This is significantly faster, because
    
    - It allows the one-element fast path to kick in on multi-
      element queries.
    - It constructs intermediate data structures more lazily
      than the old system did.
    
    It's measurably faster than the old algo even without the fast path, but
    that fast path still helps significantly.
    notriddle committed Nov 18, 2023
    Configuration menu
    Copy the full SHA
    d82b374 View commit details
    Browse the repository at this point in the history