-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
In the case of using a one-pass version of the parser (using "find_fileld"), if the field is not found, then the object has to be reset, which is logical, but not for the case when we expect that there may not be a value with the passed keys. This results in performance degradation as we reprocess the keys. This can be avoided by adding the ability to remember the position of the iterator.
Result result;
auto error = object.find_field(key).get(result);
switch (error) {
case simdjson::error_code::SUCCESS:
break;
case simdjson::error_code::NO_SUCH_FIELD:
object.reset();
break;
default:
...
}
Make something like this
auto position = object.get_current_position();
Result result;
auto error = object.find_field(key).get(result);
switch (error) {
case simdjson::error_code::SUCCESS:
break;
case simdjson::error_code::NO_SUCH_FIELD:
object.revert_position(position);
break;
default:
...
}
Metadata
Metadata
Assignees
Labels
No labels