8000 Migrating parsingcompetition to new API. (#593) · JavaScriptExpert/simdjson@7ff0345 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7ff0345

Browse files
authored
Migrating parsingcompetition to new API. (simdjson#593)
* Migrating parsingcompetition to new API. * Removing ParsedJson
1 parent 5514ae3 commit 7ff0345

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

benchmark/parsingcompetition.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,6 @@ bool bench(const char *filename, bool verbose, bool just_data, int repeat_multip
9292
std::cout << p.size() << " B";
9393
std::cout << ": will run " << repeat << " iterations." << std::endl;
9494
}
95-
simdjson::ParsedJson pj;
96-
bool allocok = pj.allocate_capacity(p.size(), 1024);
97-
98-
if (!allocok) {
99-
std::cerr << "can't allocate memory" << std::endl;
100-
return false;
101-
}
10295
int volume = p.size();
10396
if (just_data) {
10497
printf("%-42s %20s %20s %20s %20s \n", "name", "cycles_per_byte",
@@ -109,14 +102,15 @@ bool bench(const char *filename, bool verbose, bool just_data, int repeat_multip
109102
BEST_TIME("getline ",sum_line_lengths(p.data(), p.size()) , lc, ,
110103
repeat, volume, !just_data);
111104
}
112-
105+
113106
if (!just_data)
114-
BEST_TIME("simdjson (dynamic mem) ", build_parsed_json(p).is_valid(), true,
107+
BEST_TIME("simdjson (dynamic mem) ", simdjson::build_parsed_json(p).is_valid(), true,
115108
, repeat, volume, !just_data);
116109
// (static alloc)
117-
BEST_TIME("simdjson ", json_parse(p, pj), simdjson::SUCCESS, , repeat, volume,
110+
simdjson::document::parser parser;
111+
BEST_TIME("simdjson ", parser.parse(p).error(), simdjson::SUCCESS, , repeat, volume,
118112
!just_data);
119-
113+
120114
rapidjson::Document d;
121115

122116
char *buffer = (char *)malloc(p.size() + 1);

0 commit comments

Comments
 (0)
0