Replies: 4 comments 10 replies
-
|
You already can do the following with simdjson::ondemand::parser parser;
simdjson::padded_string docdata = R"({"value":"12321323213213213213213213213211223"})"_padded;
simdjson::ondemand::document doc = parser.iterate(docdata);
simdjson::ondemand::object obj = doc.get_object();
string_view token = obj["value"].raw_json_token();
// token has value "12321323213213213213213213213211223", it points inside the input string |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Thanks for answering How can I avoid this allocation? |
Beta Was this translation helpful? Give feedback.
4 replies
-
|
Note that there is an open issue aiming to optimize this aspect further... |
Beta Was this translation helpful? Give feedback.
4 replies
-
|
@kirillp What is your specific use case ? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, thank you vm for grate library.
I was surprised that get_string(std::string_view &target) always copy file content to internal buffer (even if a string doesn
t have any escaping). I have to parse very huge files (2-3-4Gb) and I'm using mapped memory to open it. I need to provide most time and memory efficient file processing. During parsing I don't need to un-escape anything, Im fine with original strings however the parser still allocates memory to store all possible strings in internal buffer.Can I control this moment somehow ?
How can I save memory and promise to avoid using get_string(std::string_view &target),
and use std::strings for that rare moments where I need to make a copy or unescape content ?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions