Benchmark memory more realistically.

Using shell.Split to benchmark produces a lot of noise from the accumulation of
the results into the output slice. To get a more accurate memory profile, use
the scanner directly and discard the tokens as they are processed.

This allows us to (still) count the total memory allocated during the split,
but does not charge it against the wrong code.

This change makes the benchmark look a little bit faster, but not enough to
worry about.
1 file changed
tree: 2653538a7b913d6b294070deedeed7c00010a580
  1. bench_test.go
  2. bitbucket-pipelines.yml
  3. go.mod
  4. LICENSE
  5. README.md
  6. shell.go
  7. shell_test.go
README.md

shell

http://godoc.org/bitbucket.org/creachadair/shell

The shell package implements basic shell command-line splitting.