miloyip / nativejson-benchmark

C/C++ JSON parser/generator benchmark
MIT License
1.98k stars 261 forks source link

ThorsSerializer #107

Closed Loki-Astari closed 6 years ago

Loki-Astari commented 6 years ago

Added ThorsSerializer library.

Fixed two build bugs.

  1. g++-5.0: src/tests/facil.io.cpp uses unsupported features of C++ So I have added include guards at the top of this file so it is not built with g++-5

  2. clang-3.7: To link the executable it requires pthread and dl libraries. I have added these requirements to the premake5.lua file.

Added New Feature

Command Line Argument

Added command line parameter . "--parser=<X>" When used will only perform tests using the specified parser <X> (this is the name returned by GetName()).

To allow you to debug one Json parser at a time.

SetUp()

Added a new version of SetUp() that takes a std::string as argument. The string passed is the name of the test. So the parser can take appropriate set up action for a particular test. The default action of this function is to call the original SetUp() with no parameters (thus maintaining backwards compatibility).

But parser can override this virtual function if they need to. The ThorsSerializer parser uses this facility because it loads each test into a specific C++ structure (it does not use a generic DOM tree).