Closed 01mf02 closed 11 months ago
This PR makes evaluation of object keys/values lazy.
Previously, the following filter would never yield a single result:
'{("a", "b"): (0 | recurse(.+1)), ("c", "d"): 2}'
Now, it generates an infinite stream of objects, just like jq.
How's performance? Let's test it with the following filter:
limit(1000000; {("a", "b"): (0 | recurse(.+1)), ("c", "d"): 2}) | empty
jq 1.7 takes 1.1 seconds, whereas jaq takes only 0.5 seconds! :)
As a bonus, this also eliminates the dependency of jaq-interpret on itertools.
jaq-interpret
itertools
This PR makes evaluation of object keys/values lazy.
Previously, the following filter would never yield a single result:
Now, it generates an infinite stream of objects, just like jq.
How's performance? Let's test it with the following filter:
jq 1.7 takes 1.1 seconds, whereas jaq takes only 0.5 seconds! :)
As a bonus, this also eliminates the dependency of
jaq-interpret
onitertools
.