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

Use `Symbol` even more #60815

Merged
merged 3 commits into from May 20, 2019
Commits on May 19, 2019
  1. Avoid `as_str()` in `ParamTy::is_self`.

    nnethercote committed May 14, 2019
    It's a hot function, and a direct `Symbol` comparison is faster.
    
    The patch also converts some `&InternedString`s to `InternedString`.
  2. Introduce `InternedString::intern`.

    nnethercote committed May 14, 2019
    `InternedString::intern(x)` is preferable to
    `Symbol::intern(x).as_interned_str()`, because the former involves one
    call to `with_interner` while the latter involves two.
    
    The case within InternedString::decode() is particularly hot, and this
    change reduces the number of `with_interner` calls by up to 13%.
  3. Introduce `LocalInternedString::intern`.

    nnethercote committed May 14, 2019
    `LocalInternedString::intern(x)` is preferable to
    `Symbol::intern(x).as_str()`, because the former involves one call to
    `with_interner` while the latter involves two.
You can’t perform that action at this time.