Skip to content

Consider making Reader::lines() reuse one buffer in place #15436

@pcwalton

Description

@pcwalton

It doesn't make a lot of sense to keep allocating over and over if the app isn't going to hold onto the strings. It hurt our perf vs. Go in https://gist.github.com/alco/5d18c046094d0abb3f58#file-timings

If the user wants new strings he or she can just convert the &str returned into a String.

cc @alexcrichton

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-slowIssue: Problems and improvements with respect to performance of generated code.P-lowLow priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions