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

Avoid allocations in Decoder::read_str. #37064

Merged
merged 1 commit into from
Oct 13, 2016
Merged

Commits on Oct 9, 2016

  1. Avoid allocations in Decoder::read_str.

    `opaque::Decoder::read_str` is very hot within `rustc` due to its use in
    the reading of crate metadata, and it currently returns a `String`. This
    commit changes it to instead return a `Cow<str>`, which avoids a heap
    allocation.
    
    This change reduces the number of calls to `malloc` by almost 10% in
    some benchmarks.
    
    This is a [breaking-change] to libserialize.
    nnethercote committed Oct 9, 2016
    Configuration menu
    Copy the full SHA
    b043e11 View commit details
    Browse the repository at this point in the history