Permalink
Browse files

Speed up calls to builtin funcs by reducing allocations

Significant speedup for most builtin function calls (slight slowdown
for split() and [g]sub()). Not sure why SimplePattern gets a slowdown.

name                    old time/op  new time/op  delta
BuiltinSplitSpace-8      112µs ± 0%   120µs ± 0%   +7.45%  (p=0.016 n=5+4)
SimplePattern-8          181ns ± 1%   188ns ± 7%   +4.21%  (p=0.008 n=5+5)
LocalVars-8              622ns ± 0%   639ns ± 1%   +2.76%  (p=0.008 n=5+5)
BuiltinSplitRegex-8      149µs ± 0%   153µs ± 2%   +2.73%  (p=0.008 n=5+5)
SetField-8               980ns ± 1%  1002ns ± 1%   +2.22%  (p=0.008 n=5+5)
BuiltinSubAmpersand-8   14.0µs ± 0%  14.2µs ± 1%   +1.08%  (p=0.008 n=5+5)
BuiltinSub-8            13.8µs ± 1%  13.9µs ± 1%   +1.06%  (p=0.032 n=5+5)
GetField-8               505ns ± 0%   509ns ± 0%   +0.83%  (p=0.008 n=5+5)
IncrDecr-8               706ns ± 1%   740ns ±12%     ~     (p=0.690 n=5+5)
BuiltinGsub-8           16.7µs ± 0%  16.7µs ± 0%     ~     (p=0.841 n=5+5)
BuiltinGsubAmpersand-8  18.0µs ± 1%  17.9µs ± 1%     ~     (p=0.095 n=5+5)
FuncCall-8              3.51µs ± 1%  3.48µs ± 2%     ~     (p=0.151 n=5+5)
ForLoop-8               5.84µs ± 1%  5.66µs ± 3%     ~     (p=0.056 n=5+5)
ForInLoop-8             1.97µs ± 2%  2.00µs ± 7%     ~     (p=1.000 n=5+5)
IfStatement-8            275ns ± 3%   275ns ± 1%     ~     (p=1.000 n=5+5)
RegexMatch-8            1.38µs ± 2%  1.43µs ± 5%     ~     (p=0.056 n=5+5)
BinaryOperators-8        812ns ± 3%   813ns ± 2%     ~     (p=0.738 n=5+5)
ConcatSmall-8            848ns ± 0%   850ns ± 1%     ~     (p=0.333 n=5+5)
ConcatLarge-8           6.61ms ± 1%  6.58ms ± 1%     ~     (p=0.421 n=5+5)
Comparisons-8            413ns ± 2%   425ns ± 3%     ~     (p=0.111 n=5+5)
Assign-8                 535ns ± 2%   535ns ± 0%     ~     (p=0.810 n=5+5)
AugAssign-8             1.98µs ± 1%  1.99µs ± 1%     ~     (p=0.548 n=5+5)
GlobalVars-8             647ns ± 1%   641ns ± 0%   -0.83%  (p=0.016 n=5+4)
RecursiveFunc-8         18.7µs ± 1%  18.5µs ± 1%   -1.39%  (p=0.016 n=5+5)
CondExpr-8               279ns ± 2%   263ns ± 2%   -5.67%  (p=0.008 n=5+5)
BuiltinSprintf-8        14.3µs ± 4%  12.6µs ± 0%  -12.50%  (p=0.008 n=5+5)
SimpleBuiltins-8        5.50µs ± 1%  4.68µs ± 0%  -14.83%  (p=0.008 n=5+5)
BuiltinMatch-8          3.77µs ± 1%  3.04µs ± 0%  -19.39%  (p=0.008 n=5+5)
ArrayOperations-8       1.80µs ± 1%  1.13µs ± 1%  -37.12%  (p=0.008 n=5+5)
BuiltinLength-8         1.62µs ± 0%  0.93µs ± 6%  -42.92%  (p=0.008 n=5+5)
BuiltinIndex-8          3.00µs ± 2%  1.56µs ± 3%  -48.17%  (p=0.008 n=5+5)
BuiltinSubstr-8         3.11µs ± 0%  1.56µs ± 5%  -49.77%  (p=0.008 n=5+5)
[Geo mean]              3.28µs       3.02µs        -7.98%
  • Loading branch information...
benhoyt committed Sep 7, 2018
1 parent af99309 commit e45e2090d44c08b340555f483e1f5bf42160e199
Showing with 237 additions and 227 deletions.
  1. +154 −154 benchmarks.txt
  2. +5 −0 goawk.go
  3. +78 −73 interp/interp.go
@@ -1,165 +1,165 @@
goos: darwin
goarch: amd64
pkg: github.com/benhoyt/goawk/interp
BenchmarkGlobalVars-8 2000000 651 ns/op
BenchmarkGlobalVars-8 2000000 646 ns/op
BenchmarkGlobalVars-8 2000000 646 ns/op
BenchmarkGlobalVars-8 2000000 644 ns/op
BenchmarkGlobalVars-8 2000000 646 ns/op
BenchmarkLocalVars-8 2000000 622 ns/op
BenchmarkLocalVars-8 2000000 620 ns/op
BenchmarkLocalVars-8 2000000 623 ns/op
BenchmarkLocalVars-8 2000000 624 ns/op
BenchmarkLocalVars-8 2000000 622 ns/op
BenchmarkIncrDecr-8 2000000 697 ns/op
BenchmarkIncrDecr-8 2000000 709 ns/op
BenchmarkIncrDecr-8 2000000 714 ns/op
BenchmarkIncrDecr-8 2000000 701 ns/op
BenchmarkIncrDecr-8 2000000 708 ns/op
BenchmarkSimpleBuiltins-8 300000 5530 ns/op
BenchmarkSimpleBuiltins-8 300000 5480 ns/op
BenchmarkSimpleBuiltins-8 300000 5494 ns/op
BenchmarkSimpleBuiltins-8 300000 5495 ns/op
BenchmarkSimpleBuiltins-8 300000 5493 ns/op
BenchmarkBuiltinMatch-8 500000 3808 ns/op
BenchmarkBuiltinMatch-8 500000 3735 ns/op
BenchmarkBuiltinMatch-8 500000 3773 ns/op
BenchmarkBuiltinMatch-8 500000 3776 ns/op
BenchmarkBuiltinMatch-8 300000 3776 ns/op
BenchmarkBuiltinLength-8 1000000 1621 ns/op
BenchmarkBuiltinLength-8 1000000 1623 ns/op
BenchmarkBuiltinLength-8 1000000 1622 ns/op
BenchmarkBuiltinLength-8 1000000 1629 ns/op
BenchmarkBuiltinLength-8 1000000 1623 ns/op
BenchmarkBuiltinIndex-8 500000 2989 ns/op
BenchmarkBuiltinIndex-8 500000 2993 ns/op
BenchmarkBuiltinIndex-8 500000 2997 ns/op
BenchmarkBuiltinIndex-8 500000 3060 ns/op
BenchmarkBuiltinIndex-8 500000 2976 ns/op
BenchmarkBuiltinSubstr-8 500000 3116 ns/op
BenchmarkBuiltinSubstr-8 500000 3112 ns/op
BenchmarkBuiltinSubstr-8 500000 3110 ns/op
BenchmarkBuiltinSubstr-8 500000 3121 ns/op
BenchmarkBuiltinSubstr-8 500000 3102 ns/op
BenchmarkBuiltinSplitSpace-8 10000 111621 ns/op
BenchmarkBuiltinSplitSpace-8 10000 111741 ns/op
BenchmarkBuiltinSplitSpace-8 10000 111563 ns/op
BenchmarkBuiltinSplitSpace-8 10000 112067 ns/op
BenchmarkBuiltinSplitSpace-8 10000 111562 ns/op
BenchmarkBuiltinSplitRegex-8 10000 148806 ns/op
BenchmarkBuiltinSplitRegex-8 10000 148910 ns/op
BenchmarkBuiltinSplitRegex-8 10000 148705 ns/op
BenchmarkBuiltinSplitRegex-8 10000 149279 ns/op
BenchmarkBuiltinSplitRegex-8 10000 148342 ns/op
BenchmarkBuiltinSub-8 100000 13817 ns/op
BenchmarkBuiltinSub-8 100000 13703 ns/op
BenchmarkBuiltinSub-8 100000 13827 ns/op
BenchmarkBuiltinSub-8 100000 13743 ns/op
BenchmarkBuiltinSub-8 100000 13905 ns/op
BenchmarkBuiltinSubAmpersand-8 100000 14080 ns/op
BenchmarkBuiltinSubAmpersand-8 100000 14010 ns/op
BenchmarkBuiltinSubAmpersand-8 100000 14023 ns/op
BenchmarkBuiltinSubAmpersand-8 100000 14041 ns/op
BenchmarkBuiltinSubAmpersand-8 100000 14010 ns/op
BenchmarkBuiltinGsub-8 100000 16691 ns/op
BenchmarkBuiltinGsub-8 100000 16758 ns/op
BenchmarkBuiltinGsub-8 100000 16701 ns/op
BenchmarkBuiltinGsub-8 100000 16593 ns/op
BenchmarkBuiltinGsub-8 100000 16634 ns/op
BenchmarkBuiltinGsubAmpersand-8 100000 17947 ns/op
BenchmarkBuiltinGsubAmpersand-8 100000 17964 ns/op
BenchmarkBuiltinGsubAmpersand-8 100000 17906 ns/op
BenchmarkBuiltinGsubAmpersand-8 100000 17912 ns/op
BenchmarkBuiltinGsubAmpersand-8 100000 18218 ns/op
BenchmarkBuiltinSprintf-8 100000 14339 ns/op
BenchmarkBuiltinSprintf-8 100000 14899 ns/op
BenchmarkBuiltinSprintf-8 100000 14189 ns/op
BenchmarkBuiltinSprintf-8 100000 14131 ns/op
BenchmarkBuiltinSprintf-8 100000 14161 ns/op
BenchmarkRecursiveFunc-8 100000 18893 ns/op
BenchmarkRecursiveFunc-8 100000 18510 ns/op
BenchmarkRecursiveFunc-8 100000 18707 ns/op
BenchmarkRecursiveFunc-8 100000 18835 ns/op
BenchmarkRecursiveFunc-8 100000 18665 ns/op
BenchmarkFuncCall-8 500000 3520 ns/op
BenchmarkFuncCall-8 500000 3518 ns/op
BenchmarkFuncCall-8 500000 3510 ns/op
BenchmarkFuncCall-8 500000 3497 ns/op
BenchmarkFuncCall-8 500000 3484 ns/op
BenchmarkForLoop-8 300000 5809 ns/op
BenchmarkForLoop-8 300000 5817 ns/op
BenchmarkForLoop-8 300000 5896 ns/op
BenchmarkForLoop-8 200000 5903 ns/op
BenchmarkForLoop-8 300000 5793 ns/op
BenchmarkForInLoop-8 1000000 1966 ns/op
BenchmarkForInLoop-8 1000000 2004 ns/op
BenchmarkForInLoop-8 1000000 1938 ns/op
BenchmarkForInLoop-8 1000000 1962 ns/op
BenchmarkForInLoop-8 1000000 1998 ns/op
BenchmarkIfStatement-8 5000000 276 ns/op
BenchmarkIfStatement-8 5000000 274 ns/op
BenchmarkIfStatement-8 5000000 282 ns/op
BenchmarkIfStatement-8 5000000 267 ns/op
BenchmarkGlobalVars-8 2000000 657 ns/op
BenchmarkGlobalVars-8 2000000 641 ns/op
BenchmarkGlobalVars-8 2000000 640 ns/op
BenchmarkGlobalVars-8 2000000 642 ns/op
BenchmarkGlobalVars-8 2000000 642 ns/op
BenchmarkLocalVars-8 2000000 645 ns/op
BenchmarkLocalVars-8 2000000 638 ns/op
BenchmarkLocalVars-8 2000000 645 ns/op
BenchmarkLocalVars-8 2000000 635 ns/op
BenchmarkLocalVars-8 2000000 634 ns/op
BenchmarkIncrDecr-8 2000000 730 ns/op
BenchmarkIncrDecr-8 2000000 829 ns/op
BenchmarkIncrDecr-8 2000000 696 ns/op
BenchmarkIncrDecr-8 2000000 762 ns/op
BenchmarkIncrDecr-8 2000000 684 ns/op
BenchmarkSimpleBuiltins-8 300000 4705 ns/op
BenchmarkSimpleBuiltins-8 300000 4691 ns/op
BenchmarkSimpleBuiltins-8 300000 4687 ns/op
BenchmarkSimpleBuiltins-8 300000 4663 ns/op
BenchmarkSimpleBuiltins-8 300000 4669 ns/op
BenchmarkBuiltinMatch-8 500000 3039 ns/op
BenchmarkBuiltinMatch-8 500000 3032 ns/op
BenchmarkBuiltinMatch-8 500000 3051 ns/op
BenchmarkBuiltinMatch-8 500000 3051 ns/op
BenchmarkBuiltinMatch-8 500000 3037 ns/op
BenchmarkBuiltinLength-8 2000000 910 ns/op
BenchmarkBuiltinLength-8 2000000 914 ns/op
BenchmarkBuiltinLength-8 2000000 910 ns/op
BenchmarkBuiltinLength-8 2000000 978 ns/op
BenchmarkBuiltinLength-8 2000000 922 ns/op
BenchmarkBuiltinIndex-8 1000000 1570 ns/op
BenchmarkBuiltinIndex-8 1000000 1516 ns/op
BenchmarkBuiltinIndex-8 1000000 1586 ns/op
BenchmarkBuiltinIndex-8 1000000 1515 ns/op
BenchmarkBuiltinIndex-8 1000000 1595 ns/op
BenchmarkBuiltinSubstr-8 1000000 1509 ns/op
BenchmarkBuiltinSubstr-8 1000000 1532 ns/op
BenchmarkBuiltinSubstr-8 1000000 1637 ns/op
BenchmarkBuiltinSubstr-8 1000000 1567 ns/op
BenchmarkBuiltinSubstr-8 1000000 1572 ns/op
BenchmarkBuiltinSplitSpace-8 10000 120243 ns/op
BenchmarkBuiltinSplitSpace-8 10000 123919 ns/op
BenchmarkBuiltinSplitSpace-8 10000 120133 ns/op
BenchmarkBuiltinSplitSpace-8 10000 120140 ns/op
BenchmarkBuiltinSplitSpace-8 10000 119603 ns/op
BenchmarkBuiltinSplitRegex-8 10000 153334 ns/op
BenchmarkBuiltinSplitRegex-8 10000 151617 ns/op
BenchmarkBuiltinSplitRegex-8 10000 156014 ns/op
BenchmarkBuiltinSplitRegex-8 10000 151189 ns/op
BenchmarkBuiltinSplitRegex-8 10000 152196 ns/op
BenchmarkBuiltinSub-8 100000 13868 ns/op
BenchmarkBuiltinSub-8 100000 14037 ns/op
BenchmarkBuiltinSub-8 100000 13951 ns/op
BenchmarkBuiltinSub-8 100000 13967 ns/op
BenchmarkBuiltinSub-8 100000 13904 ns/op
BenchmarkBuiltinSubAmpersand-8 100000 14132 ns/op
BenchmarkBuiltinSubAmpersand-8 100000 14204 ns/op
BenchmarkBuiltinSubAmpersand-8 100000 14113 ns/op
BenchmarkBuiltinSubAmpersand-8 100000 14178 ns/op
BenchmarkBuiltinSubAmpersand-8 100000 14293 ns/op
BenchmarkBuiltinGsub-8 100000 16687 ns/op
BenchmarkBuiltinGsub-8 100000 16676 ns/op
BenchmarkBuiltinGsub-8 100000 16624 ns/op
BenchmarkBuiltinGsub-8 100000 16740 ns/op
BenchmarkBuiltinGsub-8 100000 16689 ns/op
BenchmarkBuiltinGsubAmpersand-8 100000 18070 ns/op
BenchmarkBuiltinGsubAmpersand-8 100000 17876 ns/op
BenchmarkBuiltinGsubAmpersand-8 100000 17870 ns/op
BenchmarkBuiltinGsubAmpersand-8 100000 17774 ns/op
BenchmarkBuiltinGsubAmpersand-8 100000 17782 ns/op
BenchmarkBuiltinSprintf-8 100000 12524 ns/op
BenchmarkBuiltinSprintf-8 100000 12548 ns/op
BenchmarkBuiltinSprintf-8 100000 12611 ns/op
BenchmarkBuiltinSprintf-8 100000 12536 ns/op
BenchmarkBuiltinSprintf-8 100000 12533 ns/op
BenchmarkRecursiveFunc-8 100000 18587 ns/op
BenchmarkRecursiveFunc-8 100000 18432 ns/op
BenchmarkRecursiveFunc-8 100000 18502 ns/op
BenchmarkRecursiveFunc-8 100000 18458 ns/op
BenchmarkRecursiveFunc-8 100000 18334 ns/op
BenchmarkFuncCall-8 500000 3464 ns/op
BenchmarkFuncCall-8 500000 3480 ns/op
BenchmarkFuncCall-8 500000 3531 ns/op
BenchmarkFuncCall-8 500000 3459 ns/op
BenchmarkFuncCall-8 500000 3453 ns/op
BenchmarkForLoop-8 300000 5668 ns/op
BenchmarkForLoop-8 200000 5852 ns/op
BenchmarkForLoop-8 300000 5665 ns/op
BenchmarkForLoop-8 200000 5580 ns/op
BenchmarkForLoop-8 200000 5539 ns/op
BenchmarkForInLoop-8 1000000 1937 ns/op
BenchmarkForInLoop-8 1000000 2019 ns/op
BenchmarkForInLoop-8 500000 2143 ns/op
BenchmarkForInLoop-8 1000000 1955 ns/op
BenchmarkForInLoop-8 1000000 1958 ns/op
BenchmarkIfStatement-8 5000000 277 ns/op
BenchmarkCondExpr-8 5000000 282 ns/op
BenchmarkCondExpr-8 5000000 278 ns/op
BenchmarkCondExpr-8 5000000 273 ns/op
BenchmarkCondExpr-8 5000000 278 ns/op
BenchmarkCondExpr-8 5000000 283 ns/op
BenchmarkSimplePattern-8 10000000 181 ns/op
BenchmarkSimplePattern-8 10000000 182 ns/op
BenchmarkSimplePattern-8 10000000 179 ns/op
BenchmarkSimplePattern-8 10000000 179 ns/op
BenchmarkSimplePattern-8 10000000 182 ns/op
BenchmarkGetField-8 3000000 507 ns/op
BenchmarkGetField-8 3000000 503 ns/op
BenchmarkGetField-8 3000000 506 ns/op
BenchmarkGetField-8 3000000 504 ns/op
BenchmarkGetField-8 3000000 503 ns/op
BenchmarkSetField-8 2000000 975 ns/op
BenchmarkSetField-8 2000000 976 ns/op
BenchmarkSetField-8 2000000 982 ns/op
BenchmarkSetField-8 2000000 979 ns/op
BenchmarkSetField-8 2000000 987 ns/op
BenchmarkRegexMatch-8 1000000 1365 ns/op
BenchmarkIfStatement-8 5000000 274 ns/op
BenchmarkIfStatement-8 5000000 278 ns/op
BenchmarkIfStatement-8 5000000 276 ns/op
BenchmarkIfStatement-8 5000000 272 ns/op
BenchmarkCondExpr-8 5000000 267 ns/op
BenchmarkCondExpr-8 5000000 260 ns/op
BenchmarkCondExpr-8 5000000 262 ns/op
BenchmarkCondExpr-8 5000000 266 ns/op
BenchmarkCondExpr-8 5000000 260 ns/op
BenchmarkSimplePattern-8 10000000 184 ns/op
BenchmarkSimplePattern-8 10000000 201 ns/op
BenchmarkSimplePattern-8 10000000 188 ns/op
BenchmarkSimplePattern-8 10000000 183 ns/op
BenchmarkSimplePattern-8 10000000 185 ns/op
BenchmarkGetField-8 3000000 509 ns/op
BenchmarkGetField-8 3000000 508 ns/op
BenchmarkGetField-8 3000000 509 ns/op
BenchmarkGetField-8 3000000 510 ns/op
BenchmarkGetField-8 3000000 508 ns/op
BenchmarkSetField-8 2000000 1002 ns/op
BenchmarkSetField-8 1000000 1002 ns/op
BenchmarkSetField-8 2000000 997 ns/op
BenchmarkSetField-8 2000000 1010 ns/op
BenchmarkSetField-8 2000000 997 ns/op
BenchmarkRegexMatch-8 1000000 1443 ns/op
BenchmarkRegexMatch-8 1000000 1497 ns/op
BenchmarkRegexMatch-8 1000000 1405 ns/op
BenchmarkRegexMatch-8 1000000 1399 ns/op
BenchmarkRegexMatch-8 1000000 1399 ns/op
BenchmarkRegexMatch-8 1000000 1361 ns/op
BenchmarkRegexMatch-8 1000000 1400 ns/op
BenchmarkRegexMatch-8 1000000 1389 ns/op
BenchmarkBinaryOperators-8 2000000 807 ns/op
BenchmarkBinaryOperators-8 2000000 821 ns/op
BenchmarkBinaryOperators-8 2000000 837 ns/op
BenchmarkBinaryOperators-8 2000000 801 ns/op
BenchmarkBinaryOperators-8 2000000 793 ns/op
BenchmarkConcatSmall-8 2000000 849 ns/op
BenchmarkConcatSmall-8 2000000 846 ns/op
BenchmarkConcatSmall-8 2000000 848 ns/op
BenchmarkBinaryOperators-8 2000000 812 ns/op
BenchmarkBinaryOperators-8 2000000 816 ns/op
BenchmarkBinaryOperators-8 2000000 796 ns/op
BenchmarkBinaryOperators-8 2000000 822 ns/op
BenchmarkConcatSmall-8 2000000 847 ns/op
BenchmarkConcatSmall-8 2000000 848 ns/op
BenchmarkConcatLarge-8 200 6624363 ns/op
BenchmarkConcatLarge-8 200 6624162 ns/op
BenchmarkConcatLarge-8 200 6546654 ns/op
BenchmarkConcatLarge-8 200 6602732 ns/op
BenchmarkConcatLarge-8 200 6630010 ns/op
BenchmarkComparisons-8 3000000 412 ns/op
BenchmarkComparisons-8 3000000 422 ns/op
BenchmarkConcatSmall-8 2000000 857 ns/op
BenchmarkConcatSmall-8 2000000 848 ns/op
BenchmarkConcatSmall-8 2000000 850 ns/op
BenchmarkConcatLarge-8 200 6597232 ns/op
BenchmarkConcatLarge-8 200 6550770 ns/op
BenchmarkConcatLarge-8 200 6539738 ns/op
BenchmarkConcatLarge-8 200 6562946 ns/op
BenchmarkConcatLarge-8 200 6663110 ns/op
BenchmarkComparisons-8 5000000 436 ns/op
BenchmarkComparisons-8 3000000 433 ns/op
BenchmarkComparisons-8 3000000 411 ns/op
BenchmarkComparisons-8 3000000 412 ns/op
BenchmarkComparisons-8 5000000 408 ns/op
BenchmarkArrayOperations-8 1000000 1807 ns/op
BenchmarkArrayOperations-8 1000000 1798 ns/op
BenchmarkArrayOperations-8 1000000 1791 ns/op
BenchmarkArrayOperations-8 1000000 1809 ns/op
BenchmarkArrayOperations-8 1000000 1803 ns/op
BenchmarkAssign-8 3000000 540 ns/op
BenchmarkComparisons-8 5000000 416 ns/op
BenchmarkComparisons-8 3000000 428 ns/op
BenchmarkArrayOperations-8 1000000 1138 ns/op
BenchmarkArrayOperations-8 1000000 1128 ns/op
BenchmarkArrayOperations-8 1000000 1120 ns/op
BenchmarkArrayOperations-8 1000000 1148 ns/op
BenchmarkArrayOperations-8 1000000 1130 ns/op
BenchmarkAssign-8 2000000 536 ns/op
BenchmarkAssign-8 3000000 535 ns/op
BenchmarkAssign-8 3000000 536 ns/op
BenchmarkAssign-8 3000000 524 ns/op
BenchmarkAssign-8 3000000 548 ns/op
BenchmarkAssign-8 3000000 528 ns/op
BenchmarkAugAssign-8 1000000 1988 ns/op
BenchmarkAugAssign-8 1000000 1993 ns/op
BenchmarkAugAssign-8 1000000 1990 ns/op
BenchmarkAugAssign-8 1000000 1968 ns/op
BenchmarkAugAssign-8 1000000 1980 ns/op
BenchmarkAssign-8 3000000 535 ns/op
BenchmarkAssign-8 3000000 534 ns/op
BenchmarkAugAssign-8 1000000 2001 ns/op
BenchmarkAugAssign-8 1000000 1979 ns/op
BenchmarkAugAssign-8 1000000 1989 ns/op
BenchmarkAugAssign-8 1000000 1997 ns/op
BenchmarkAugAssign-8 1000000 1983 ns/op
PASS
ok github.com/benhoyt/goawk/interp 319.389s
ok github.com/benhoyt/goawk/interp 318.079s
@@ -32,8 +32,13 @@ package main
TODO:
- performance testing: I/O, allocations, CPU
+ other TODOs in interp.go and parser.go
+ other uses of make() in interp.go
+ resolve array variables at parse time (by index instead of name)
+ resolve array parameters to functions at parse time and clean up userCall
+ benchmark against awk/gawk with some real awk scripts
+ ways to optimize sub()/gsub()
+ optimize lexer
+ optimize parser
- move ast (except Program) to "internal" package?
- break up interp.go? structure it better and add comments
- think about length() and substr() chars vs bytes:
Oops, something went wrong.

0 comments on commit e45e209

Please sign in to comment.