There are 3 levels of execution modes; compile time, runtime, and simd. The default and currently supported mode is ' compile_time'. The others are often not faster or as well tested.
compile_time
- This option allows constexpr parsing. In the future the other modes maybe faster and better supported. It may use builtins and runtime only methods when appropriate when detection of the current evaluation mode is available (e.gis_constant_evaluated
)runtime
- This mode includescompile_time
methods along with using methods only available at runtime ( e.gmemchr
).simd
- This mode includesruntime
methods along with some simd enhanced methods (e.g. in number parsing).
compile_time
The string data passed to from_json
is zero terminated. This allows some potential
optimizations around bounds checking. If the type passed to from_json
has a specialization
of daw::json::is_zero_terminated_string
it will be assumed to be zero terminated. By default, std::basic_string
evaluates to being a zero terminated string.
no
- Bounds checking does not take advantage of assuming a terminated stringyes
- The string passed tofrom_json
is zero terminated
no
or the value of thedaw::json::is_zero_terminated_string
specialization for the String input type
Are comments in whitespace allowed(defaults to no) and, if so, what kind
none
- Comments are not allowed. This is conformant with JSON and the fastestcpp
- Allow C++ style comments, both/* comment */
and// comment until newline
are allowed in places where whitespace is allowed/requiredhash
- Allow# comment until newline
hash style line comments (e.g# comment
)
none
Do a checked parse or not. If the data is known to be trustworthy and generated correctly, one can disable checking of a parse and gain performance(measured 15% in some documents).
yes
- All checks are performedno
- Disable many parse time checks, assumes perfect input
yes
Assume the document in minified and there is no whitespace. This may offer performance benefits( measured 5% in some minified documents). This option is incompatible with comments.
no
- Assumes there is whitespace in document.yes
- Does not skip whitespace in documents, assumes a minified document.
no