top | item 38464181

(no title)

6figurelenins | 2 years ago

FWIW, I see no difference. (hyperfine 1.17.0, jq 1.7, jaq 1.2.0)

  $ hyperfine -N -w 100 -m 1000 -L bin jq,jaq "echo '[1,2,3]' | {bin} '.[1]'"
  Benchmark 1: echo '[1,2,3]' | jq '.[1]'
    Time (mean ± σ):       3.4 ms ±   1.7 ms    [User: 0.6 ms, System: 2.6 ms]
    Range (min … max):     0.7 ms …   5.8 ms    1000 runs
 
  Benchmark 2: echo '[1,2,3]' | jaq '.[1]'
    Time (mean ± σ):       3.4 ms ±   1.7 ms    [User: 0.5 ms, System: 2.7 ms]
    Range (min … max):     0.7 ms …   5.8 ms    1000 runs
 
  Summary
    echo '[1,2,3]' | jq '.[1]' ran
      1.00 ± 0.71 times faster than echo '[1,2,3]' | jaq '.[1]'

discuss

order

jerf|2 years ago

That would still be a microbenchmark. Given that the benchmarks in the post take on the order of seconds to run, I am assuming they are not microbenchmarks, or at least, much less "micro"benchmarks. I would hope some sort of standard JSON querying benchmarking suite would include some substantial, hundreds-of-kilobyes or more JSON samples in it.