jacksontj / dataman

MIT License
9 stars 4 forks source link

Stream perf #89

Closed jacksontj closed 5 years ago

jacksontj commented 5 years ago

Change the record heap to have direct methods which are the exact type, to avoid heap allocations.

benchmark                                 old ns/op     new ns/op     delta
BenchmarkResultStream-4                   402831        423458        +5.12%
BenchmarkResultStreamTransformation-4     436764        441225        +1.02%
BenchmarkMergeResultStreamsUnique-4       3174205       3160286       -0.44%
BenchmarkMergeResultStreams-4             2794211       2780949       -0.47%

benchmark                                 old allocs     new allocs     delta
BenchmarkResultStream-4                   10             10             +0.00%
BenchmarkResultStreamTransformation-4     11             11             +0.00%
BenchmarkMergeResultStreamsUnique-4       7439           5438           -26.90%
BenchmarkMergeResultStreams-4             3417           1418           -58.50%

benchmark                                 old bytes     new bytes     delta
BenchmarkResultStream-4                   537           537           +0.00%
BenchmarkResultStreamTransformation-4     545           545           +0.00%
BenchmarkMergeResultStreamsUnique-4       954497        922452        -3.36%
BenchmarkMergeResultStreams-4             901354        869434        -3.54%