-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Enhancement](stream-load-json) using simdjson to parse json #11665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4a82e18 to
919102d
Compare
919102d to
06bf6eb
Compare
yiguolei
approved these changes
Aug 16, 2022
Contributor
yiguolei
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
eldenmoon
added a commit
to eldenmoon/incubator-doris
that referenced
this pull request
Feb 18, 2023
be config: enable_simdjson_reader=true related PR apache#11665
5 tasks
eldenmoon
added a commit
to eldenmoon/incubator-doris
that referenced
this pull request
Feb 18, 2023
be config: enable_simdjson_reader=true related PR apache#11665
qidaye
pushed a commit
that referenced
this pull request
Feb 21, 2023
be config: enable_simdjson_reader=true related PR #11665
yagagagaga
pushed a commit
to yagagagaga/doris
that referenced
this pull request
Mar 9, 2023
…16903) be config: enable_simdjson_reader=true related PR apache#11665
luwei16
pushed a commit
to luwei16/Doris
that referenced
this pull request
Apr 7, 2023
* (Enhancement)[load-json] support simdjson in new json reader (apache#16903) be config: enable_simdjson_reader=true related PR apache#11665 * [Optimize](simd json reader) Cached search results for previous row (keyed as index in JSON object) - used as a hint. (apache#17124) * [Optimize](simd json reader) Cached search results for previous row (keyed as index in JSON object) - used as a hint. `_simdjson_set_column_value` could become a hot spot while parsing json in simdjson mode, introduce `_prev_positions` to cache results for previous row (keyed as index in JSON object) due to the json name field order, should be quite the same between each lines * fix case
swjtu-zhanglei
pushed a commit
to swjtu-zhanglei/incubator-doris
that referenced
this pull request
Jul 25, 2023
… (apache#1445) * (Enhancement)[load-json] support simdjson in new json reader (apache#16903) be config: enable_simdjson_reader=true related PR apache#11665 * [Optimize](simd json reader) Cached search results for previous row (keyed as index in JSON object) - used as a hint. (apache#17124) * [Optimize](simd json reader) Cached search results for previous row (keyed as index in JSON object) - used as a hint. `_simdjson_set_column_value` could become a hot spot while parsing json in simdjson mode, introduce `_prev_positions` to cache results for previous row (keyed as index in JSON object) due to the json name field order, should be quite the same between each lines * fix case
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
Currently we use rapidjson to parse json document, It's fast but not fast enough compare to simdjson.And I found that the simdjson has a parsing front-end called simdjson::ondemand which will parse json when accessing fields and could strip the field token from the original document, using this feature we could reduce the cost of string copy(eg. we convert everthing to a string literal in _write_data_to_column by sprintf, I saw a hotspot from the flamegrame in this function, using simdjson::to_json_string will strip the token(a string piece) which is std::string_view and this is exactly we need).And second in _set_column_value we could iterate through the json document by for (auto field: object_val) {xxx}, this is much faster than looking up a field by it's field name like objectValue.FindMember("k1").The third optimization is the at_pointer interface simdjson provided, this could directly get the json field from original document.
Issue Number: close #11663
Problem summary
using simdjson to parse in vjsonscanner.
Checklist(Required)
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...