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
// It is safe to call this method in goroutines, to reuse a parsed [*Query].
// But for arguments, do not give values sharing same data between goroutines.
In addition to this preventing reusing JSON data in gojq queries across goroutines, it also becomes an unnecessary performance hit for the use case of executing multiple different queries against the same JSON data. Maybe not a common use case, but it is the whole reason I began using gojq (see https://github.com/samsullivan/jqless for the use case).
gojq/query.go
Lines 22 to 23 in 111b6ef
In addition to this preventing reusing JSON data in
gojq
queries across goroutines, it also becomes an unnecessary performance hit for the use case of executing multiple different queries against the same JSON data. Maybe not a common use case, but it is the whole reason I began usinggojq
(see https://github.com/samsullivan/jqless for the use case).The main culprit is that any numeric values in the JSON data interface need to be normalized: https://github.com/itchyny/gojq/blob/main/normalize.go
The text was updated successfully, but these errors were encountered: