commit | 1425d3176896932e270efd687dae93e38e557160 | [log] [tgz] |
---|---|---|
author | M. J. Fromberger <michael.j.fromberger@gmail.com> | Mon Jun 03 09:25:40 2019 -0700 |
committer | M. J. Fromberger <michael.j.fromberger@gmail.com> | Mon Jun 03 09:29:07 2019 -0700 |
tree | ef2af7c16684f7c30ab43633496605cccbfec960 | |
parent | c36b5a63b8369f08149a9f5986fcc5a8fa51babe [diff] |
Replace classOf with a lookup table. Improve performance of byte classification using a static lookup table. The improvement over a function is not as great as the gain from using a function over a map, but it's enough to be worthwhile. ``` BENCHMARK BEFORE AFTER SPEEDUP (%) BenchmarkSplit/len_1-12 570 563 1.2 BenchmarkSplit/len_4-12 612 600 2.0 BenchmarkSplit/len_16-12 714 704 1.4 BenchmarkSplit/len_64-12 1119 1082 3.3 BenchmarkSplit/len_256-12 2965 2799 5.6 BenchmarkSplit/len_1024-12 10216 8928 12.6 BenchmarkSplit/len_4096-12 39333 33102 15.8 BenchmarkSplit/len_16384-12 158126 130540 17.4 BenchmarkSplit/len_65536-12 669554 566011 15.5 BenchmarkSplit/len_100739-12 1039795 884622 14.9 ```
http://godoc.org/bitbucket.org/creachadair/shell
The shell
package implements basic shell command-line splitting.