Skip to content

Investigation notes for flag analogous to JSON_BIGINT_AS_STRING #76

@TysonAndre

Description

@TysonAndre

This may or may not be difficult with the dom parser.

Future simdjson C releases may make this easier but this functionality might not be planned for arbitrary-precision integers (only floats) - https://github.com/simdjson/simdjson/pull/1886 is in review pending manual tests and performance testing.

  • See my PR comment for a note on how BIGINT might be possible in followup

https://github.com/simdjson/simdjson/issues/167 suggests it's possible with the ondemand parser, but that may be slightly slower than the dom parser?


https://github.com/simdjson/simdjson/issues/425#issuecomment-883605600 mentions this is supported in the ondemand api

We may want to take the tiny performance hit just to imitate php's behavior for numbers in json_decode()

Note that this is effectively supported now with the On Demand API and documented as such:

simdjson::ondemand::parser parser;
simdjson::padded_string docdata =  R"({"value":12321323213213213213213213213211223})"_padded;
simdjson::ondemand::document doc = parser.iterate(docdata);
simdjson::ondemand::object obj = doc.get_object();
std::string_view token = obj["value"].raw_json_token();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions