Skip to content

Commit 8589a05

Browse files
committed
More clever parse function.
1 parent 7ca9ae8 commit 8589a05

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎benchmark/parse.cpp‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ using namespace std;
3737
int main(int argc, char *argv[]) {
3838
bool verbose = false;
3939
bool dump = false;
40+
bool jsonoutput = false;
4041
bool forceoneiteration = false;
4142

4243
int c;
@@ -50,6 +51,9 @@ int main(int argc, char *argv[]) {
5051
case 'd':
5152
dump = true;
5253
break;
54+
case 'j':
55+
jsonoutput = true;
56+
break;
5357
case '1':
5458
forceoneiteration = true;
5559
break;
@@ -201,7 +205,12 @@ int main(int argc, char *argv[]) {
201205
cout << "Min: " << min_result << " bytes read: " << p.size()
202206
<< " Gigabytes/second: " << (p.size()) / (min_result * 1000000000.0)
203207
<< "\n";
204-
if(dump) pj.printjson();
208+
if(jsonoutput) {
209+
isok = isok && pj.printjson();
210+
}
211+
if(dump) {
212+
isok = isok && pj.dump_raw_tape();
213+
}
205214
if (!isok) {
206215
printf(" Parsing failed. \n ");
207216
return EXIT_FAILURE;

‎include/simdjson/parsedjson.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ struct ParsedJson {
225225
return true;
226226
}
227227

228+
WARN_UNUSED
228229
bool dump_raw_tape() {
229230
size_t tapeidx = 0;
230231
u64 tape_val = tape[tapeidx++];

0 commit comments

Comments
 (0)