Adding version with string validation.

This commit is contained in:
Daniel Lemire 2018-05-08 12:29:08 -04:00
parent 750978bef9
commit 5835b77a00
2 changed files with 3 additions and 1 deletions

0
scalarvssimd/bench.cpp Normal file
View File

View File

@ -82,12 +82,14 @@ int main(int argc, char *argv[]) {
char * buffer = (char *) malloc(p.second);
memcpy(buffer, p.first, p.second);
buffer[p.second] = '\0';
BEST_TIME(d.Parse<kParseValidateEncodingFlag>((const char *)buffer).HasParseError(), false,
memcpy(buffer, p.first, p.second), repeat, volume, true);
BEST_TIME(d.Parse((const char *)buffer).HasParseError(), false,
memcpy(buffer, p.first, p.second), repeat, volume, true);
BEST_TIME(d.ParseInsitu(buffer).HasParseError(), false,
memcpy(buffer, p.first, p.second), repeat, volume, true);
size_t strlength = rapidstringme((char*) p.first).size();
std::cout << "input length is "<< p.second << " stringified length is " << strlength << std::endl;
std::cout << "input length is "<< p.second << " stringified length is " << strlength << std::endl;
BEST_TIME_NOCHECK(rapidstringme((char*) p.first), , repeat, volume,
true);
free(buffer);