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.
This PR delays the execution of many core filters.
For example, before this change, the filter
1, debug
printed:After this change, this prints:
This is more consistent with jq, which yields:
In some cases, this makes filters terminate which did not terminate before. For example,
yielded no single output before, because
sort_by
was executed before 1 was yielded. With this PR, jaq yields 1 (just like jq).Previously, also the
last/1
filter was executed strictly. With this PR, it is implemented by definition in a naturally lazy way.This makes the
bf-fib
benchmark a bit slower (runtime decreases from 414.8 ms to 485.3 ms), but it remains still a lot faster than in jq or gojq. This also makes the evaluation fairer, because jq also implementslast/1
by definition.