NVIDIA / NVIDIA/cudf

[FEA] Replace internal usage of std::string with std::string_view

Open
#15,907 4 comments 0 reactions 1 assignee Claimed by @lamarrr View on GitHub
feature request libcudf
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Is your feature request related to a problem? Please describe.**
There are currently a number of libcudf functions that accept a std::string argument when they don't need to own the string but could simply use a view. Others take a const ref to a std::string, explicitly indicating that they don't require ownership. These include:
- https://github.com/rapidsai/cudf/blob/ce247961216dd70f389763dc086f137c11ad7346/cpp/include/cudf/aggregation.hpp#L559
- https://github.com/rapidsai/cudf/blob/ce247961216dd70f389763dc086f137c11ad7346/cpp/include/cudf/interop.hpp#L107
- https://github.com/rapidsai/cudf/blob/ce247961216dd70f389763dc086f137c11ad7346/cpp/include/cudf/io/types.hpp#L210 (multiple in this file)
- https://github.com/rapidsai/cudf/blob/ce247961216dd70f389763dc086f137c11ad7346/cpp/include/cudf/io/json.hpp#L386 (multiple in this file, and also all other I/O format files like csv.hpp)

There may be others as well.

**Describe the solution you'd like**
We should do a thorough audit of std::string usage in libcudf to ensure that we are properly using std::string_view instead where appropriate.

**Additional context**
A subset of this request was originally documented in https://github.com/rapidsai/cudf/issues/14413, which indicates that some of these changes may be nontrivial to implement.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.