-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbenchmark_spirit.cpp
More file actions
32 lines (31 loc) · 839 Bytes
/
benchmark_spirit.cpp
File metadata and controls
32 lines (31 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// Copyright (C) 2013 Mateusz Loskot <[email protected]>
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#include "json_benchmark.hpp"
#include <ciere/json/value.hpp>
#include <ciere/json/io.hpp>
namespace cj = ciere::json;
int main()
{
try
{
jsonbench::run_benchmark("spirit", [](std::string const& s) {
cj::value jv;
bool const parsed = cj::construct(s, jv);
#ifdef JSON_BENCHMARK_DUMP_PARSED_JSON
std::cout << jv << std::endl;
#endif
return parsed && jv.type() != cj::null_type;
});
return EXIT_SUCCESS;
}
catch (std::exception const& e)
{
std::cerr << e.what() <<std::endl;
}
return EXIT_FAILURE;
}