Anis Elleuch
6542bc4a03
sql, csv: Cache some values between Read() calls to gain performance ( #9645 )
...
Below is the benchmark enhancement after this commit:
benchmark old ns/op new ns/op delta
BenchmarkRead-8 2807 2189 -22.02%
BenchmarkReadWithFieldsPerRecord-8 2802 2179 -22.23%
BenchmarkReadWithoutFieldsPerRecord-8 2824 2181 -22.77%
BenchmarkReadLargeFields-8 3584 3371 -5.94%
BenchmarkReadReuseRecord-8 2044 1480 -27.59%
BenchmarkReadReuseRecordWithFieldsPerRecord-8 2056 1483 -27.87%
BenchmarkReadReuseRecordWithoutFieldsPerRecord-8 2047 1482 -27.60%
BenchmarkReadReuseRecordLargeFields-8 2777 2594 -6.59%
benchmark old allocs new allocs delta
BenchmarkRead-8 26 16 -38.46%
BenchmarkReadWithFieldsPerRecord-8 26 16 -38.46%
BenchmarkReadWithoutFieldsPerRecord-8 26 16 -38.46%
BenchmarkReadLargeFields-8 36 24 -33.33%
BenchmarkReadReuseRecord-8 16 6 -62.50%
BenchmarkReadReuseRecordWithFieldsPerRecord-8 16 6 -62.50%
BenchmarkReadReuseRecordWithoutFieldsPerRecord-8 16 6 -62.50%
BenchmarkReadReuseRecordLargeFields-8 24 12 -50.00%
benchmark old bytes new bytes delta
BenchmarkRead-8 672 664 -1.19%
BenchmarkReadWithFieldsPerRecord-8 672 664 -1.19%
BenchmarkReadWithoutFieldsPerRecord-8 672 664 -1.19%
BenchmarkReadLargeFields-8 3948 3936 -0.30%
BenchmarkReadReuseRecord-8 32 24 -25.00%
BenchmarkReadReuseRecordWithFieldsPerRecord-8 32 24 -25.00%
BenchmarkReadReuseRecordWithoutFieldsPerRecord-8 32 24 -25.00%
BenchmarkReadReuseRecordLargeFields-8 2988 2976 -0.40%
5 years ago