Replies: 1 comment 1 reply
-
Hey, I haven't done much detailed benchmarking of jq code but when i've needed it i've done it via https://github.com/itchyny/gojq and the golang tooling for profiling, a bit awkward but you can usually get some hints what is slow. I guess something similar can be done with C tooling. Might also be tricky if jq and gojq differ in TCO etc. I did do a hacky opcode level profiler for gojq some years ago, maybe i can digg it up or recreate it if your interested. Otherwise for rough benchmarking i usually just use I'll try think of more things but one thing that has bitten me is: avoid concat arrays and strings, instead collect and then join etc. And i agree jq is a wonderful language :) |
Beta Was this translation helpful? Give feedback.
-
I'm building a module and I am looking for ideas to evaluate the performance of different functions. I'm interested in both time and memory usage, but mostly time.
For more context, I'm writing a series of functions which will be useful for converting healthcare data from json (FHIR) to a tabular format (OMOP).
I am already concerned that I'll need to profile my implementations of some of these helper functions, and selectively target my hot spots. Since I'm also learning the subtleties of the language, I expect I'll make some bad decisions until I've internalized all the features.
Having something like pprof, perf, gprof, etc would be fine.
PS> Thank you for this wonderful language!!
Beta Was this translation helpful? Give feedback.
All reactions