Skip to content

Optimizing runtime performance for the literal string case #39

Description

@nyurik

Rust compiler at present is unable to generate as efficient code for write!(f, "string") as it can do for f.write_str("string"). I tried to look through the code, but it seems fairly complex in how you generate the output token stream. Would it be possible to handle the case when the string is known ahead of time and does not contain either { or } characters, and use the write_str instead?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions