Skip to content

optim: Store indices instead of making new SmartStrings #9

@cdown

Description

@cdown

About ~12% of time is spent in doing conversions from &str to SmartString, which may require a reallocation anyway.

  1. https://github.com/bodil/smartstring/blob/e407ca23c747257a812d2d2e70bf336412718c3a/src/lib.rs#L646
  2. (or if inline): https://github.com/bodil/smartstring/blob/e407ca23c747257a812d2d2e70bf336412718c3a/src/inline.rs#L83

Maybe we can just store the indices instead of converting to and from SmartStrings? We only need a Borrowed anyway at self.get() time. No idea if it would actually be faster.

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