std::string_view support
Hi i'd like to request C++17's std::string_view support for this lib. Afaik it may be faster in some situations rather than the old const std::string&
Hi @IlannM - are you proposing the rapidcsv API to provide functions returning/accepting std::string_view, or are you referring to the internal data representation of a CSV document in the library?
I have previously done some study implementing "my own string_view" for internal data representation and I did not observe any measurable performance improvement. The reason is likely that std::string can store typical cell sizes without extra memory allocation, but I haven't investigated it further. Memory usage should be reduced though, but I'm not sure it warrants bumping the C++ requirement to 17 (nor maintaining two "backends" - one for C++11 and one for >= C++17).
yes, I am referring to the API returning and accepting the std::string_view type.
Thanks for clarifying.
I think the performance benefit for using std::string_view in the API's is small, given the fact that most CSV data cells are small.
I think if I eventually change rapidcsv to use string_view internally, I'll profile the performance and see if we should add such APIs.
For now I'll close this issue.