Is it possible to load file directly into the std::string_view?
Directly = without creating the proxy std::string from stringstream.
It would make a lot of my code faster.
If I understand what you are asking, no.
std::string_view refers to a region of memory, but it does not own that memory. This means that an std::string_view requires that another object exist which actually holds the char objects that it refers to.
If an std::string_view is referring to an std::string and that string's lifetime ends, then the std::string_view is now effectively a dangling reference/pointer and trying to read characters from it would cause undefined behavior.
Note that std::string_view can refer to contiguous sequences of char objects aside from std::string, such as a simple char array or an std::vector<char>, but regardless of what it refers to, the referent must exist at least as long as the std::string_view will be used.
mmap() the file, you can construct a std::string_view directly against the memory-mapped region, as indicated in the other answer. (Boost is not required, but gives proper RAII to the mmap resource.)If you have access to boost, you can point a string view to the data() of a boost::iostreams::mapped_file. 
It is actually quite easy with C++20 and std::ostringstream::view:
std::ifstream file {file_path};
std::ostringstream oss {};
oss << file.rdbuf();
// Use std::ostringstream::view to avoid a string copy
// But remember that std::string_view does not own the memory!
my_function(oss.view());
stringstreamfor. Add the code for that, or ask another question about it, and there's good odds someone can give you a hand trimming it out.mmap(linux) orvirutal mapping(win32) learn.microsoft.com/en-us/windows/win32/memory/file-mapping