Skip to content

Insight on original performance difference #1

Open
@polarathene

Description

@polarathene

Your article on the topic was the third search result that came up for me. I think you clarified it well with semantics, thanks 😁


Just adding some information regarding this part of your write-up:

the first result it gives me was [Converting &str: to_string vs to_owned (with two benchmarks)][3]. I read the post and coundn't believe the performance difference
they said. After more researches I realized that the post is wrong (or maybe is
outdated becuase it was posted in 2016), and I worried about there might be other

There is this comment from 2016 on the topic:

Now that specialization for str::to_string() has landed, we can safely say that to_string() has the same performance as to_owned()

The post you came across was likely accurate until the newer rust release with that optimization landed 👍

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