You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i had a performance issue in a script that i tracked down to essentially this when . was an array including large number of values and nested objects.
.a?//false
using GOJQ_DEBUG=1 ... -tags debug (very useful) i could see that issue is probably that the huge value that fails being index:ed gets serialized by *expectedObjectError.Error() and doing a hack in gojq.typeErrorPreview it seems to conform it.
Here is a easy way to reproduce the issue:
go run cmd/gojq/main.go -n '[range(1000000)] | repeat(.a? // "a")'
I guess an improvement could be to somehow limit depth/array iteration in the preview function? or maybe the call to Error() can be deferred until it's actually is needed somehow?
The text was updated successfully, but these errors were encountered:
Hi, i had a performance issue in a script that i tracked down to essentially this when
.
was an array including large number of values and nested objects.using
GOJQ_DEBUG=1 ... -tags debug
(very useful) i could see that issue is probably that the huge value that fails being index:ed gets serialized by*expectedObjectError.Error()
and doing a hack ingojq.typeErrorPreview
it seems to conform it.Here is a easy way to reproduce the issue:
go run cmd/gojq/main.go -n '[range(1000000)] | repeat(.a? // "a")'
I guess an improvement could be to somehow limit depth/array iteration in the preview function? or maybe the call to
Error()
can be deferred until it's actually is needed somehow?The text was updated successfully, but these errors were encountered: