Open louiswins opened 1 year ago
Hi @louiswins, right now Djinni uses std::string
as the C++ side mapping of the string
type. If we use string_view
for constants, this means we will need to differentiate string constants and normal strings. This complicates things for both djinni itself and djinni users.
Right now djinni creates a static
std::string const
for each string constant. This adds a bunch of static initializers which perform allocations and copy data onto the heap. This increases startup times (static initializers run beforemain
) when we could just reference that data directly in aconstexpr std::string_view
for free.