I discovered room for optimization when comparing 2 empty std::string_view s in GCC. However, Clang already seems to be optimized for this use case. See this quick bench run: https://quick-bench.com/q/FZc2abFbpI5Q_lEHXF7sNGC_Jn4 . Looking at this implementation of the STL, it seems like there is room for improvement as well: if both std:string_view s have the same size, something like memcmp is called. I couldn't verify this because quick bench doesn't support MSVC (yet).
I originally discovered this optimization here: microsoft/vcpkg-tool#843