Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support string_view for string constants in C++ #142

Open
louiswins opened this issue May 15, 2023 · 1 comment
Open

Support string_view for string constants in C++ #142

louiswins opened this issue May 15, 2023 · 1 comment

Comments

@louiswins
Copy link
Contributor

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 before main) when we could just reference that data directly in a constexpr std::string_view for free.

@li-feng-sc
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants