Skip to content

Commit 4f08283

Browse files
committed
Use simdjson::builtin instead of haswell/begin+end
1 parent 0162d10 commit 4f08283

File tree

11 files changed

+18
-51
lines changed

11 files changed

+18
-51
lines changed

benchmark/bench_ondemand.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ SIMDJSON_PUSH_DISABLE_ALL_WARNINGS
77
#include <benchmark/benchmark.h>
88
SIMDJSON_POP_DISABLE_WARNINGS
99

10-
#if SIMDJSON_IMPLEMENTATION_HASWELL
11-
#include "simdjson/haswell/begin.h"
12-
#endif // SIMDJSON_IMPLEMENTATION_HASWELL
13-
1410
#include "partial_tweets/ondemand.h"
1511
#include "partial_tweets/iter.h"
1612
#include "partial_tweets/dom.h"
@@ -24,7 +20,3 @@ SIMDJSON_POP_DISABLE_WARNINGS
2420
#include "kostya/dom.h"
2521

2622
BENCHMARK_MAIN();
27-
28-
#if SIMDJSON_IMPLEMENTATION_HASWELL
29-
#include "simdjson/haswell/end.h"
30-
#endif // SIMDJSON_IMPLEMENTATION_HASWELL

benchmark/bench_sax.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,7 @@ SIMDJSON_PUSH_DISABLE_ALL_WARNINGS
88
#include <benchmark/benchmark.h>
99
SIMDJSON_POP_DISABLE_WARNINGS
1010

11-
12-
#if SIMDJSON_IMPLEMENTATION_HASWELL
13-
#include "simdjson/haswell/begin.h"
14-
#endif // SIMDJSON_IMPLEMENTATION_HASWELL
15-
1611
#include "partial_tweets/sax.h"
1712
#include "largerandom/sax.h"
1813

1914
BENCHMARK_MAIN();
20-
21-
#if SIMDJSON_IMPLEMENTATION_HASWELL
22-
#include "simdjson/haswell/end.h"
23-
#endif // SIMDJSON_IMPLEMENTATION_HASWELL

benchmark/kostya/iter.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#pragma once
22

3-
#ifdef SIMDJSON_IMPLEMENTATION
43
#if SIMDJSON_EXCEPTIONS
54

65
#include "kostya.h"
76

87
namespace kostya {
98

109
using namespace simdjson;
11-
using namespace simdjson::SIMDJSON_IMPLEMENTATION;
10+
using namespace simdjson::builtin;
1211

1312
class Iter {
1413
public:
@@ -21,12 +20,12 @@ class Iter {
2120
ondemand::parser parser{};
2221
std::vector<my_point> container{};
2322

24-
simdjson_really_inline simdjson_result<double> first_double(SIMDJSON_IMPLEMENTATION::ondemand::json_iterator &iter, const char *key) {
23+
simdjson_really_inline simdjson_result<double> first_double(ondemand::json_iterator &iter, const char *key) {
2524
if (!iter.start_object() || ondemand::raw_json_string(iter.field_key()) != key || iter.field_value()) { throw "Invalid field"; }
2625
return iter.get_double();
2726
}
2827

29-
simdjson_really_inline simdjson_result<double> next_double(SIMDJSON_IMPLEMENTATION::ondemand::json_iterator &iter, const char *key) {
28+
simdjson_really_inline simdjson_result<double> next_double(ondemand::json_iterator &iter, const char *key) {
3029
if (!iter.has_next_field() || ondemand::raw_json_string(iter.field_key()) != key || iter.field_value()) { throw "Invalid field"; }
3130
return iter.get_double();
3231
}
@@ -95,4 +94,3 @@ BENCHMARK_TEMPLATE(KostyaSum, Iter);
9594
} // namespace kostya
9695

9796
#endif // SIMDJSON_EXCEPTIONS
98-
#endif // SIMDJSON_IMPLEMENTATION

benchmark/kostya/ondemand.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#pragma once
22

3-
#ifdef SIMDJSON_IMPLEMENTATION
43
#if SIMDJSON_EXCEPTIONS
54

65
#include "kostya.h"
76

87
namespace kostya {
98

109
using namespace simdjson;
11-
using namespace simdjson::SIMDJSON_IMPLEMENTATION;
10+
using namespace simdjson::builtin;
1211

1312
class OnDemand {
1413
public:
@@ -75,4 +74,3 @@ BENCHMARK_TEMPLATE(KostyaSum, OnDemand);
7574
} // namespace kostya
7675

7776
#endif // SIMDJSON_EXCEPTIONS
78-
#endif // SIMDJSON_IMPLEMENTATION

benchmark/largerandom/iter.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#pragma once
22

3-
#ifdef SIMDJSON_IMPLEMENTATION
43
#if SIMDJSON_EXCEPTIONS
54

65
#include "largerandom.h"
76

87
namespace largerandom {
98

109
using namespace simdjson;
11-
using namespace simdjson::SIMDJSON_IMPLEMENTATION;
10+
using namespace simdjson::builtin;
1211

1312
class Iter {
1413
public:
@@ -21,12 +20,12 @@ class Iter {
2120
ondemand::parser parser{};
2221
std::vector<my_point> container{};
2322

24-
simdjson_really_inline double first_double(SIMDJSON_IMPLEMENTATION::ondemand::json_iterator &iter) {
23+
simdjson_really_inline double first_double(ondemand::json_iterator &iter) {
2524
if (iter.start_object().error() || iter.field_key().error() || iter.field_value()) { throw "Invalid field"; }
2625
return iter.get_double();
2726
}
2827

29-
simdjson_really_inline double next_double(SIMDJSON_IMPLEMENTATION::ondemand::json_iterator &iter) {
28+
simdjson_really_inline double next_double(ondemand::json_iterator &iter) {
3029
if (!iter.has_next_field() || iter.field_key().error() || iter.field_value()) { throw "Invalid field"; }
3130
return iter.get_double();
3231
}
@@ -91,4 +90,3 @@ BENCHMARK_TEMPLATE(LargeRandomSum, Iter);
9190
} // namespace largerandom
9291

9392
#endif // SIMDJSON_EXCEPTIONS
94-
#endif // SIMDJSON_IMPLEMENTATION

benchmark/largerandom/ondemand.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#pragma once
22

3-
#ifdef SIMDJSON_IMPLEMENTATION
43
#if SIMDJSON_EXCEPTIONS
54

65
#include "largerandom.h"
76

87
namespace largerandom {
98

109
using namespace simdjson;
11-
using namespace simdjson::SIMDJSON_IMPLEMENTATION;
10+
using namespace simdjson::builtin;
1211

1312
class OnDemand {
1413
public:
@@ -72,4 +71,3 @@ BENCHMARK_TEMPLATE(LargeRandomSum, OnDemand);
7271
} // namespace largerandom
7372

7473
#endif // SIMDJSON_EXCEPTIONS
75-
#endif // SIMDJSON_IMPLEMENTATION

benchmark/largerandom/sax.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
#pragma once
22

3-
#ifdef SIMDJSON_IMPLEMENTATION
43
#if SIMDJSON_EXCEPTIONS
54

65
#include "largerandom.h"
76

87
namespace largerandom {
98

109
using namespace simdjson;
11-
using namespace SIMDJSON_IMPLEMENTATION;
12-
using namespace SIMDJSON_IMPLEMENTATION::stage2;
10+
using namespace simdjson::builtin;
11+
using namespace simdjson::builtin::stage2;
1312

1413
class Sax {
1514
public:
@@ -28,8 +27,8 @@ class Sax {
2827
};
2928

3029
using namespace simdjson;
31-
using namespace SIMDJSON_IMPLEMENTATION;
32-
using namespace SIMDJSON_IMPLEMENTATION::stage2;
30+
using namespace simdjson::builtin;
31+
using namespace simdjson::builtin::stage2;
3332
struct sax_point_reader_visitor {
3433
public:
3534
std::vector<my_point> &points;
@@ -123,4 +122,3 @@ BENCHMARK_TEMPLATE(LargeRandom, Sax);
123122
} // namespace largerandom
124123

125124
#endif // SIMDJSON_EXCEPTIONS
126-
#endif // SIMDJSON_IMPLEMENTATION

benchmark/partial_tweets/iter.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#pragma once
22

3-
#ifdef SIMDJSON_IMPLEMENTATION
43
#if SIMDJSON_EXCEPTIONS
54

65
#include "partial_tweets.h"
76

87
namespace partial_tweets {
98

109
using namespace simdjson;
11-
using namespace simdjson::SIMDJSON_IMPLEMENTATION;
10+
using namespace simdjson::builtin;
1211

1312
class Iter {
1413
public:
@@ -92,4 +91,3 @@ BENCHMARK_TEMPLATE(PartialTweets, Iter);
9291
} // namespace partial_tweets
9392

9493
#endif // SIMDJSON_EXCEPTIONS
95-
#endif // SIMDJSON_IMPLEMENTATION

benchmark/partial_tweets/ondemand.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#pragma once
22

3-
#ifdef SIMDJSON_IMPLEMENTATION
43
#if SIMDJSON_EXCEPTIONS
54

65
#include "partial_tweets.h"
76

87
namespace partial_tweets {
98

109
using namespace simdjson;
11-
using namespace simdjson::SIMDJSON_IMPLEMENTATION;
10+
using namespace simdjson::builtin;
1211

1312
class OnDemand {
1413
public:
@@ -57,4 +56,3 @@ BENCHMARK_TEMPLATE(PartialTweets, OnDemand);
5756
} // namespace partial_tweets
5857

5958
#endif // SIMDJSON_EXCEPTIONS
60-
#endif // SIMDJSON_IMPLEMENTATION

benchmark/partial_tweets/sax.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
#pragma once
22

3-
#ifdef SIMDJSON_IMPLEMENTATION
43

54
#include "partial_tweets.h"
65
#include "sax_tweet_reader_visitor.h"
76

87
namespace partial_tweets {
98

109
using namespace simdjson;
11-
using namespace SIMDJSON_IMPLEMENTATION;
12-
using namespace SIMDJSON_IMPLEMENTATION::stage2;
10+
using namespace simdjson::builtin;
11+
using namespace simdjson::builtin::stage2;
1312

1413
class Sax {
1514
public:
@@ -68,4 +67,3 @@ BENCHMARK_TEMPLATE(PartialTweets, Sax);
6867

6968
} // namespace partial_tweets
7069

71-
#endif // SIMDJSON_IMPLEMENTATION

benchmark/partial_tweets/sax_tweet_reader_visitor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
namespace partial_tweets {
88

99
using namespace simdjson;
10-
using namespace SIMDJSON_IMPLEMENTATION;
11-
using namespace SIMDJSON_IMPLEMENTATION::stage2;
10+
using namespace simdjson::builtin;
11+
using namespace simdjson::builtin::stage2;
1212

1313
struct sax_tweet_reader_visitor {
1414
public:

0 commit comments

Comments
 (0)