search: move to awk for formatted output
search: move to awk for formatted output

Up to 6x faster for long output:

> hyperfine 'aur pkglist -i | aur search -i - --format-stdin'  # awk
Benchmark 1: aur pkglist -i | aur search -i - --format-stdin'
  Time (mean ± σ):      5.283 s ±  0.029 s    [User: 6.728 s, System: 0.383 s]
  Range (min … max):    5.250 s …  5.339 s    10 runs

> hyperfine 'aur pkglist -i | aur search -i - --format-stdin'  # bash
Benchmark 1: aur pkglist -i | aur search -i - --format-stdin'
  Time (mean ± σ):     32.362 s ±  0.275 s    [User: 26.088 s, System: 20.809 s]
  Range (min … max):   32.030 s … 32.901 s    10 runs

Up to 47x faster for short output:

> hyperfine 'aur pkglist -i | aur search --format-stdin'  # awk
Benchmark 1: aur pkglist -i | aur search --format-stdin
  Time (mean ± σ):      1.482 s ±  0.201 s    [User: 1.568 s, System: 0.235 s]
  Range (min … max):    1.389 s …  2.052 s    10 runs

  Warning: The first benchmarking run for this command was significantly slower than the rest (2.052 s).

> hyperfine 'aur pkglist -i | aur search --format-stdin'  # bash
Benchmark 1: aur pkglist -i | aur search --format-stdin
  Time (mean ± σ):     70.208 s ± 10.874 s    [User: 57.604 s, System: 22.659 s]  (!!!)
  Range (min … max):   60.059 s … 93.046 s    10 runs

For small inputs, there is still a ~2x difference:

> hyperfine 'aur search aur'  # awk
Benchmark 1: aur search aur
  Time (mean ± σ):     193.4 ms ±  15.1 ms    [User: 142.1 ms, System: 45.1 ms]
  Range (min … max):   158.0 ms … 212.3 ms    18 runs

> hyperfine 'aur search aur'  # bash
Benchmark 1: aur search aur
  Time (mean ± σ):     381.7 ms ±  21.6 ms    [User: 329.3 ms, System: 47.5 ms]
  Range (min … max):   325.6 ms … 400.2 ms    10 runs

AladW/aurutils,AladW/aurutils