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

refactor(compiler): zero-copy deserialization when possible #14608

Merged
merged 3 commits into from
Sep 29, 2024

Commits on Sep 27, 2024

  1. refactor: zero-copy deserialization when possible

    Found this during PR review.
    
    We could leverage `#[serde(borrow)]` for zero-copy deserialization for
    messages from the compiler.
    
    We can't use `&str` fields because they may contain escape sequences
    in the future, which fails the deserialization.
    See serde-rs/json#742
    weihanglo committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    9a6a945 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cdba1c7 View commit details
    Browse the repository at this point in the history
  3. refactor: use Cow on artifact notification

    `artifact` field is an (absolute) path to emitted artifact like
    /home/projects/foo/target/debug/deps/libbar-73d672db2af2c9a8.rmeta
    
    It is worth not copying them.
    weihanglo committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    d6b740f View commit details
    Browse the repository at this point in the history