8000 parser.load should take a `string_view` or `c_str`? · Issue #2336 · simdjson/simdjson · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
parser.load should take a string_view or c_str? #2336
Open
@edbird

Description

@edbird

Is your feature request related to a problem? Please describe.

The parser.load function takes a reference to a std::string which specifies the filename.

Describe the solution you'd like

Ideally if there were a version of this function which took a std::string_view then it would not be necessary to construct a std::string, thus eliminating one memory allocation.

Describe alternatives you've considered

It could also take a c_str, since the string_view will likely be constructed from a const char* anyway.

Are you willing to contribute code or documentation toward this new feature?

I can probably look into this if I have some time, but not in the immediate future. I anticipate it to be an easy change.

I can go ahead to do it. If I have missed something, or there are reasons why this change should not be made, please do make me aware.

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

      0