Added std::minify
This commit is contained in:
parent
be707dbb6f
commit
1b6258ec8c
|
@ -45,6 +45,14 @@ std::string rapid_stringme(char *json) {
|
||||||
return buffer.GetString();
|
return buffer.GetString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string simdjson_stringme(simdjson::padded_string & json) {
|
||||||
|
std::stringstream ss;
|
||||||
|
dom::parser parser;
|
||||||
|
dom::element doc = parser.parse(json);
|
||||||
|
ss << simdjson::minify(doc);
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
int c;
|
int c;
|
||||||
|
@ -103,6 +111,11 @@ int main(int argc, char *argv[]) {
|
||||||
BEST_TIME_NOCHECK(
|
BEST_TIME_NOCHECK(
|
||||||
"despacing with RapidJSON Insitu", rapid_stringme_insitu((char *)buffer),
|
"despacing with RapidJSON Insitu", rapid_stringme_insitu((char *)buffer),
|
||||||
memcpy(buffer, p.data(), p.size()), repeat, volume, !just_data);
|
memcpy(buffer, p.data(), p.size()), repeat, volume, !just_data);
|
||||||
|
|
||||||
|
BEST_TIME_NOCHECK(
|
||||||
|
"despacing with std::minify", simdjson_stringme(p),, repeat, volume, !just_data);
|
||||||
|
|
||||||
|
|
||||||
memcpy(buffer, p.data(), p.size());
|
memcpy(buffer, p.data(), p.size());
|
||||||
size_t outlength;
|
size_t outlength;
|
||||||
uint8_t *cbuffer = (uint8_t *)buffer;
|
uint8_t *cbuffer = (uint8_t *)buffer;
|
||||||
|
|
Loading…
Reference in New Issue