Skip to content
This repository was archived by the owner on Nov 9, 2025. It is now read-only.
This repository was archived by the owner on Nov 9, 2025. It is now read-only.

SmolStrBuilder is less efficient than String for len > 23 #94

@alexheretic

Description

@alexheretic

SmolStrBuilder will allocate at least twice when building a len > 23 SmolStr.

  1. When upgrading SmolStrBuilder(Inline) -> SmolStrBuilder(Heap).
  2. On SmolStrBuilder::finish when constructing SmolStr(Heap) (because String -> Arc<str> requires this).

Ideally it would only allocate once in this case as with using String.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions