On Friday, November 23, 2018 at 1:58:37 PM UTC-7, Ben Hoyt wrote: > > So my main suggestion (for spakin/awk) would be able to wrap os.Stdout in > a bufio.NewWriter (and be sure to call Flush before Run finishes). If the > user wants to pass an unbuffered version, they still can, but at least the > default is performant. > > I also added CPU profiling to the spakin/awk script, and it looks like > it's doing a bunch more garbage collection than GoAWK, as well as some > regexp stuff. I suspect NewValue() is probably quite slow as it takes an > interface{} and does type checking. Also, strings are converted to numbers > using a regex, which is probably slower than a dedicated conversion/check > function (see parseFloatPrefix in goawk/interp/value.go). > > See more optimization ideas in my post at > https://benhoyt.com/writings/goawk/ >
Thanks for doing the performance analysis of spakin/awk <https://github.com/spakin/awk>! Once I find the time to work on that project some more, I'll certainly look into implementing some of your suggestions. — Scott -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.