3434#include " simdjson/parsedjson.h"
3535#include " simdjson/stage1_find_marks.h"
3636#include " simdjson/stage2_build_tape.h"
37+
38+ // Global arguments
39+ static bool find_marks_only = false ;
40+
3741namespace simdjson {
3842Architecture _find_best_supported_implementation () {
3943 constexpr uint32_t haswell_flags =
@@ -63,6 +67,9 @@ extern unified_functype *unified_ptr;
6367extern stage1_functype *stage1_ptr;
6468
6569int unified_machine_dispatch (const uint8_t *buf, size_t len, ParsedJson &pj) {
70+ if (find_marks_only) {
71+ return simdjson::SUCCESS;
72+ }
6673 Architecture best_implementation = _find_best_supported_implementation ();
6774 // Selecting the best implementation
6875 switch (best_implementation) {
@@ -129,7 +136,7 @@ int main(int argc, char *argv[]) {
129136#ifndef _MSC_VER
130137 int c;
131138
132- while ((c = getopt (argc, argv, " 1vdtn:w:" )) != -1 ) {
139+ while ((c = getopt (argc, argv, " 1vdtn:w:f " )) != -1 ) {
133140 switch (c) {
134141 case ' n' :
135142 iterations = atoi (optarg);
@@ -152,6 +159,9 @@ int main(int argc, char *argv[]) {
152159 case ' 1' :
153160 force_one_iteration = true ;
154161 break ;
162+ case ' f' :
163+ find_marks_only = true ;
164+ break ;
155165 default :
156166 abort ();
157167 }
@@ -326,7 +336,7 @@ int main(int argc, char *argv[]) {
326336 isok = (simdjson::stage1_ptr ((const uint8_t *)p.data (), p.size (), pj) ==
327337 simdjson::SUCCESS);
328338 isok = isok &&
329- (simdjson::SUCCESS ==
339+ (simdjson::SUCCESS ==
330340 simdjson::unified_ptr ((const uint8_t *)p.data (), p.size (), pj));
331341 auto end = std::chrono::steady_clock::now ();
332342 std::chrono::duration<double > secs = end - start;
0 commit comments