2021-10-10 20:26:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
#include <cstdint>
|
|
|
|
#include <filesystem>
|
|
|
|
#include <fstream>
|
|
|
|
#include <iostream>
|
|
|
|
#include <stdexcept>
|
|
|
|
#include <string>
|
2021-10-18 12:12:22 +00:00
|
|
|
#include <utility>
|
2021-10-13 22:33:08 +00:00
|
|
|
#include <map>
|
2021-10-10 20:26:30 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2021-10-18 11:07:24 +00:00
|
|
|
//#define TEST_JSON_PERFORMANCE
|
2021-10-11 18:52:22 +00:00
|
|
|
|
2021-10-18 23:39:26 +00:00
|
|
|
#define USE_SIMDJSON_JSON // 13 seconds (24)
|
|
|
|
//#define USE_RAPIDJSON_JSON // 19 seconds (32)
|
|
|
|
//#define USE_BOOST_JSON // 26 seconds (32)
|
|
|
|
//#define USE_NLOHMANN_JSON // 56 seconds (79)
|
|
|
|
//#define USE_JSONCPP_JSON // 80 seconds (91)
|
2021-10-18 10:54:01 +00:00
|
|
|
|
|
|
|
#ifdef USE_SIMDJSON_JSON
|
|
|
|
# define JSON_PREFER_PASS_BY_VALUE
|
|
|
|
# define JSON_PREFER_REUSE_OF_PARSER
|
|
|
|
# include "simdjson/simdjson.h"
|
|
|
|
#endif
|
2021-10-11 13:59:23 +00:00
|
|
|
|
2021-10-18 23:39:26 +00:00
|
|
|
#ifdef USE_RAPIDJSON_JSON
|
2021-10-19 08:28:13 +00:00
|
|
|
# define RAPIDJSON_HAS_STDSTRING 1
|
|
|
|
# define RAPIDJSON_SSE42
|
2021-10-18 23:39:26 +00:00
|
|
|
# include "rapidjson/document.h"
|
|
|
|
#endif
|
|
|
|
|
2021-10-11 13:59:23 +00:00
|
|
|
#ifdef USE_BOOST_JSON
|
|
|
|
# include <boost/json.hpp>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_NLOHMANN_JSON
|
|
|
|
# include "nlohmann/json.hpp"
|
2021-10-11 18:13:05 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_JSONCPP_JSON
|
2021-10-12 09:10:45 +00:00
|
|
|
# define JSON_PREFER_REUSE_OF_PARSER
|
2021-10-11 18:13:05 +00:00
|
|
|
# include <json/json.h>
|
|
|
|
#endif
|