Skip to content

Commit 95dd33a

Browse files
committed
Allow -f
1 parent 462858e commit 95dd33a

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

benchmark/parse.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
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+
3741
namespace simdjson {
3842
Architecture _find_best_supported_implementation() {
3943
constexpr uint32_t haswell_flags =
@@ -63,6 +67,9 @@ extern unified_functype *unified_ptr;
6367
extern stage1_functype *stage1_ptr;
6468

6569
int 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;

scripts/checkperf.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ make parse
2929
make perfdiff
3030

3131
echo "Running perfdiff:"
32-
echo ./perfdiff \"$current/parse -t $perftests\" \"$reference/parse -t $perftests\"
33-
./perfdiff "$current/parse -t $perftests" "$reference/parse -t $perftests"
32+
echo ./perfdiff \"$current/parse -t $perftests $CHECKPERF_ARGS\" \"$reference/parse -t $perftests $CHECKPERF_ARGS\"
33+
./perfdiff "$current/parse -t $perftests $CHECKPERF_ARGS" "$reference/parse -t $perftests $CHECKPERF_ARGS"

0 commit comments

Comments
 (0)