Re: [go-nuts] Re: Table-driven benchmarks defeat inlining

2021-06-07 Thread Ian Davis
Go does a good job of making it easy to do the right thing, especially in tests (such as parallel benchmarks or setting env variables), and avoiding the need for tricks like package level variables or noinline directives seems a useful feature. On Mon, 7 Jun 2021, at 4:47 PM, peterGo wrote: >

Re: [go-nuts] Re: Table-driven benchmarks defeat inlining

2021-06-07 Thread peterGo
Ian, I don't know whether it is feasible. It is unnecessary. A benchmark should be treated as a scientific experiment. If we do that with Paul's benchmarks and write them in scientific form, then we get the expected results. $ benchstat xpt.txt name

Re: [go-nuts] Re: Table-driven benchmarks defeat inlining

2021-06-07 Thread Ian Davis
Would it be feasible for the Go tool to disable inlining and deadcode elimination of code within the bodies of Benchmarks and Tests? Not the code under test of course. It could be as crude as disabling these optimizations for files in _test.go files. On Sun, 6 Jun 2021, at 1:33 PM, Paul S.