itchyny / gojq

Pure Go implementation of jq
MIT License
3.3k stars 119 forks source link

Support concurrency / improved performance for multiple queries on same JSON payload #237

Open samsullivan opened 9 months ago

samsullivan commented 9 months ago

RE: https://github.com/itchyny/gojq/issues/236

I don't love the naming decisions of this implementation, but the main idea is that I needed a way to run normalize numbers once for a JSON payload. Should also be backwards compatible with existing functions.

For an example implementation: https://github.com/samsullivan/jqless/pull/3

samsullivan commented 9 months ago

Also, the type safety isn't the best here, since you can convert any interface to gojq.PreparedData without actually normalizing numbers...

smithxxl commented 8 months ago

Fantastic work @samsullivan ! Hopefully this gets tested and approved :)