-
Notifications
You must be signed in to change notification settings - Fork 350
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
Optimize json parsing for validation #5181
Conversation
fe4e904
to
034839d
Compare
Ok(()) | ||
} else { | ||
Err(format!( | ||
"failed to parse datetime `{:?}`: value is larger than i64::MAX", |
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.
this code is unreachable since as_f64
always succeeds
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.
I can't unwrap though, always returning Some
is an implementation detail of serde_borrow_json. I'll change the error message.
quickwit/quickwit-doc-mapper/src/default_doc_mapper/field_mapping_entry.rs
Show resolved
Hide resolved
This uses serde_json_borrow to avoid most allocation, copying, and inserting in hashmap as we deserialize documents. Before: validation is taking 10.25% of the CPU After validation is taking 5.9% of the CPU.
ab1d19f
to
5e0062c
Compare
No description provided.