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: reduce GC work during search #83077

Merged
merged 13 commits into from
Mar 16, 2021

Commits on Mar 13, 2021

  1. Get rid of the garbage produced by getObjectFromId

    There is no reason for this function to return an object,
    since it is always used for getting at the name anyhow.
    It's used in the inner loop for some popular functions,
    so we want to avoid allocating in it.
    notriddle committed Mar 13, 2021
    Configuration menu
    Copy the full SHA
    5fe3b87 View commit details
    Browse the repository at this point in the history
  2. In checkGenerics and checkType, don't use Array.prototype.splice so much

    Every time splice() is called, another temporary object is created.
    This version, which uses plain objects as a sort of Hash Bag,
    should only produce one temporary object each time it's called.
    notriddle committed Mar 13, 2021
    Configuration menu
    Copy the full SHA
    d7971e5 View commit details
    Browse the repository at this point in the history
  3. Eagerly generate the underscore-less name to search on

    Basically, it doesn't make sense to generate those things every time
    you search. That generates a bunch of stuff for the GC to clean up,
    when, if the user wanted to do another search, it would just need
    to re-do it again.
    notriddle committed Mar 13, 2021
    Configuration menu
    Copy the full SHA
    3f70bfa View commit details
    Browse the repository at this point in the history
  4. Update src/librustdoc/html/static/main.js

    Co-authored-by: Guillaume Gomez <[email protected]>
    notriddle and GuillaumeGomez authored Mar 13, 2021
    Configuration menu
    Copy the full SHA
    b76a3d3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ca04ce3 View commit details
    Browse the repository at this point in the history
  6. Fix jslint warnings

    notriddle committed Mar 13, 2021
    Configuration menu
    Copy the full SHA
    b7d14b1 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7834aeb View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    26f85cc View commit details
    Browse the repository at this point in the history
  9. Remove tab character

    notriddle committed Mar 13, 2021
    Configuration menu
    Copy the full SHA
    d92f840 View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2021

  1. Avoid generating new strings for names that have no undescores

    This should have negligible effect on time, but it cuts about 1MiB
    off of resident memory usage.
    notriddle committed Mar 14, 2021
    Configuration menu
    Copy the full SHA
    0bfd142 View commit details
    Browse the repository at this point in the history
  2. Use a number for row.id, instead of a string

    There's no reason for it to be a string, since it's only used for
    de-duplicating the results arrays anyhow.
    notriddle committed Mar 14, 2021
    Configuration menu
    Copy the full SHA
    f57d715 View commit details
    Browse the repository at this point in the history
  3. Make nameWithoutUndescores lowercased

    This basically fixes a search bug introduced by earlier changes.
    notriddle committed Mar 14, 2021
    Configuration menu
    Copy the full SHA
    8eba927 View commit details
    Browse the repository at this point in the history

Commits on Mar 15, 2021

  1. Configuration menu
    Copy the full SHA
    dcba95f View commit details
    Browse the repository at this point in the history