@@ -26,7 +26,7 @@ static void recover_one_string(State& state) {
2626 cerr << " could not parse string" << error << endl;
2727 return ;
2828 }
29- for (UNUSED auto _ : state) {
29+ for (SIMDJSON_UNUSED auto _ : state) {
3030 std::string_view v;
3131 error = doc.get (v);
3232 if (error) {
@@ -59,7 +59,7 @@ static void serialize_twitter(State& state) {
5959 return ;
6060 }
6161 size_t bytes = 0 ;
62- for (UNUSED auto _ : state) {
62+ for (SIMDJSON_UNUSED auto _ : state) {
6363 std::string serial = simdjson::minify (doc);
6464 bytes += serial.size ();
6565 benchmark::DoNotOptimize (serial);
@@ -83,7 +83,7 @@ static void numbers_scan(State& state) {
8383 cerr << " could not read " << NUMBERS_JSON << " as an array: " << error << endl;
8484 return ;
8585 }
86- for (UNUSED auto _ : state) {
86+ for (SIMDJSON_UNUSED auto _ : state) {
8787 std::vector<double > container;
8888 for (auto e : arr) {
8989 double x;
@@ -105,7 +105,7 @@ static void numbers_size_scan(State& state) {
105105 cerr << " could not read " << NUMBERS_JSON << " as an array: " << error << endl;
106106 return ;
107107 }
108- for (UNUSED auto _ : state) {
108+ for (SIMDJSON_UNUSED auto _ : state) {
109109 std::vector<double > container;
110110 container.resize (arr.size ());
111111 size_t pos = 0 ;
@@ -131,7 +131,7 @@ static void numbers_type_scan(State& state) {
131131 cerr << " could not read " << NUMBERS_JSON << " as an array" << endl;
132132 return ;
133133 }
134- for (UNUSED auto _ : state) {
134+ for (SIMDJSON_UNUSED auto _ : state) {
135135 std::vector<double > container;
136136 for (auto e : arr) {
137137 dom::element_type actual_type = e.type ();
@@ -157,7 +157,7 @@ static void numbers_type_size_scan(State& state) {
157157 cerr << " could not read " << NUMBERS_JSON << " as an array: " << error << endl;
158158 return ;
159159 }
160- for (UNUSED auto _ : state) {
160+ for (SIMDJSON_UNUSED auto _ : state) {
161161 std::vector<double > container;
162162 container.resize (arr.size ());
163163 size_t pos = 0 ;
@@ -182,7 +182,7 @@ static void numbers_load_scan(State& state) {
182182 dom::parser parser;
183183 dom::array arr;
184184 simdjson::error_code error;
185- for (UNUSED auto _ : state) {
185+ for (SIMDJSON_UNUSED auto _ : state) {
186186 // this may hit the disk, but probably just once
187187 if ((error = parser.load (NUMBERS_JSON ).get (arr))) {
188188 cerr << " could not read " << NUMBERS_JSON << " as an array: " << error << endl;
@@ -205,7 +205,7 @@ static void numbers_load_size_scan(State& state) {
205205 dom::parser parser;
206206 dom::array arr;
207207 simdjson::error_code error;
208- for (UNUSED auto _ : state) {
208+ for (SIMDJSON_UNUSED auto _ : state) {
209209 // this may hit the disk, but probably just once
210210 if ((error = parser.load (NUMBERS_JSON ).get (arr))) {
211211 cerr << " could not read " << NUMBERS_JSON << " as an array" << endl;
@@ -234,7 +234,7 @@ static void numbers_exceptions_scan(State& state) {
234234 // Prints the number of results in twitter.json
235235 dom::parser parser;
236236 dom::array arr = parser.load (NUMBERS_JSON );
237- for (UNUSED auto _ : state) {
237+ for (SIMDJSON_UNUSED auto _ : state) {
238238 std::vector<double > container;
239239 for (double x : arr) {
240240 container.push_back (x);
@@ -249,7 +249,7 @@ static void numbers_exceptions_size_scan(State& state) {
249249 // Prints the number of results in twitter.json
250250 dom::parser parser;
251251 dom::array arr = parser.load (NUMBERS_JSON );
252- for (UNUSED auto _ : state) {
252+ for (SIMDJSON_UNUSED auto _ : state) {
253253 std::vector<double > container;
254254 container.resize (arr.size ());
255255 size_t pos = 0 ;
@@ -269,7 +269,7 @@ static void numbers_type_exceptions_scan(State& state) {
269269 // Prints the number of results in twitter.json
270270 dom::parser parser;
271271 dom::array arr = parser.load (NUMBERS_JSON );
272- for (UNUSED auto _ : state) {
272+ for (SIMDJSON_UNUSED auto _ : state) {
273273 std::vector<double > container;
274274 for (auto e : arr) {
275275 dom::element_type actual_type = e.type ();
@@ -288,7 +288,7 @@ static void numbers_type_exceptions_size_scan(State& state) {
288288 // Prints the number of results in twitter.json
289289 dom::parser parser;
290290 dom::array arr = parser.load (NUMBERS_JSON );
291- for (UNUSED auto _ : state) {
291+ for (SIMDJSON_UNUSED auto _ : state) {
292292 std::vector<double > container;
293293 container.resize (arr.size ());
294294 size_t pos = 0 ;
@@ -309,7 +309,7 @@ BENCHMARK(numbers_type_exceptions_size_scan);
309309static void numbers_exceptions_load_scan (State& state) {
310310 // Prints the number of results in twitter.json
311311 dom::parser parser;
312- for (UNUSED auto _ : state) {
312+ for (SIMDJSON_UNUSED auto _ : state) {
313313 // this may hit the disk, but probably just once
314314 dom::array arr = parser.load (NUMBERS_JSON );
315315 std::vector<double > container;
@@ -325,7 +325,7 @@ BENCHMARK(numbers_exceptions_load_scan);
325325static void numbers_exceptions_load_size_scan (State& state) {
326326 // Prints the number of results in twitter.json
327327 dom::parser parser;
328- for (UNUSED auto _ : state) {
328+ for (SIMDJSON_UNUSED auto _ : state) {
329329 // this may hit the disk, but probably just once
330330 dom::array arr = parser.load (NUMBERS_JSON );
331331 std::vector<double > container;
@@ -346,7 +346,7 @@ static void twitter_count(State& state) {
346346 // Prints the number of results in twitter.json
347347 dom::parser parser;
348348 dom::element doc = parser.load (TWITTER_JSON );
349- for (UNUSED auto _ : state) {
349+ for (SIMDJSON_UNUSED auto _ : state) {
350350 uint64_t result_count = doc[" search_metadata" ][" count" ];
351351 if (result_count != 100 ) { return ; }
352352 }
@@ -359,7 +359,7 @@ static void iterator_twitter_count(State& state) {
359359 // Prints the number of results in twitter.json
360360 padded_string json = padded_string::load (TWITTER_JSON );
361361 ParsedJson pj = build_parsed_json (json);
362- for (UNUSED auto _ : state) {
362+ for (SIMDJSON_UNUSED auto _ : state) {
363363 ParsedJson::Iterator iter (pj);
364364 // uint64_t result_count = doc["search_metadata"]["count"];
365365 if (!iter.move_to_key (" search_metadata" )) { return ; }
@@ -377,7 +377,7 @@ static void twitter_default_profile(State& state) {
377377 // Count unique users with a default profile.
378378 dom::parser parser;
379379 dom::element doc = parser.load (TWITTER_JSON );
380- for (UNUSED auto _ : state) {
380+ for (SIMDJSON_UNUSED auto _ : state) {
381381 set<string_view> default_users;
382382 for (dom::object tweet : doc[" statuses" ]) {
383383 dom::object user = tweet[" user" ];
@@ -395,7 +395,7 @@ static void twitter_image_sizes(State& state) {
395395 dom::parser parser;
396396 dom::element doc = parser.load (TWITTER_JSON );
397397 simdjson::error_code error;
398- for (UNUSED auto _ : state) {
398+ for (SIMDJSON_UNUSED auto _ : state) {
399399 set<tuple<uint64_t , uint64_t >> image_sizes;
400400 for (dom::object tweet : doc[" statuses" ]) {
401401 dom::array media;
@@ -420,7 +420,7 @@ static void error_code_twitter_count(State& state) noexcept {
420420 simdjson::error_code error;
421421 dom::element doc;
422422 if ((error = parser.load (TWITTER_JSON ).get (doc))) { return ; }
423- for (UNUSED auto _ : state) {
423+ for (SIMDJSON_UNUSED auto _ : state) {
424424 uint64_t value;
425425 if ((error = doc[" search_metadata" ][" count" ].get (value))) { return ; }
426426 if (value != 100 ) { return ; }
@@ -434,7 +434,7 @@ static void error_code_twitter_default_profile(State& state) noexcept {
434434 simdjson::error_code error;
435435 dom::element doc;
436436 if ((error = parser.load (TWITTER_JSON ).get (doc))) { std::cerr << error << std::endl; return ; }
437- for (UNUSED auto _ : state) {
437+ for (SIMDJSON_UNUSED auto _ : state) {
438438 set<string_view> default_users;
439439
440440 dom::array tweets;
@@ -464,7 +464,7 @@ static void iterator_twitter_default_profile(State& state) {
464464 auto error = padded_string::load (TWITTER_JSON ).get (json);
465465 if (error) { std::cerr << error << std::endl; return ; }
466466 ParsedJson pj = build_parsed_json (json);
467- for (UNUSED auto _ : state) {
467+ for (SIMDJSON_UNUSED auto _ : state) {
468468 set<string_view> default_users;
469469 ParsedJson::Iterator iter (pj);
470470
@@ -505,7 +505,7 @@ static void error_code_twitter_image_sizes(State& state) noexcept {
505505 simdjson::error_code error;
506506 dom::element doc;
507507 if ((error = parser.load (TWITTER_JSON ).get (doc))) { std::cerr << error << std::endl; return ; }
508- for (UNUSED auto _ : state) {
508+ for (SIMDJSON_UNUSED auto _ : state) {
509509 set<tuple<uint64_t , uint64_t >> image_sizes;
510510 dom::array statuses;
511511 if ((error = doc[" statuses" ].get (statuses))) { return ; }
@@ -537,7 +537,7 @@ static void iterator_twitter_image_sizes(State& state) {
537537 auto error = padded_string::load (TWITTER_JSON ).get (json);
538538 if (error) { std::cerr << error << std::endl; return ; }
539539 ParsedJson pj = build_parsed_json (json);
540- for (UNUSED auto _ : state) {
540+ for (SIMDJSON_UNUSED auto _ : state) {
541541 set<tuple<uint64_t , uint64_t >> image_sizes;
542542 ParsedJson::Iterator iter (pj);
543543
@@ -602,7 +602,7 @@ static void print_json(State& state) noexcept {
602602
603603 int code = json_parse (json, parser);
604604 if (code) { cerr << error_message (code) << endl; return ; }
605- for (UNUSED auto _ : state) {
605+ for (SIMDJSON_UNUSED auto _ : state) {
606606 std::stringstream s;
607607 if (!parser.print_json (s)) { cerr << " print_json failed" << endl; return ; }
608608 }
0 commit comments