jacksontj / dataman

MIT License
9 stars 4 forks source link

Use concrete types for stream, this allows these to be stack allocated #87

Closed jacksontj closed 6 years ago

jacksontj commented 6 years ago

instead of heap allocated reducing allocations and time by ~99%

benchmark                               old ns/op     new ns/op     delta
BenchmarkMergeResultStreamsUnique-4     41733870      71448         -99.83%
BenchmarkMergeResultStreams-4           36409736      70792         -99.81%

benchmark                               old allocs     new allocs     delta
BenchmarkMergeResultStreamsUnique-4     84210          236            -99.72%
BenchmarkMergeResultStreams-4           44072          113            -99.74%

benchmark                               old bytes     new bytes     delta
BenchmarkMergeResultStreamsUnique-4     9658043       28734         -99.70%
BenchmarkMergeResultStreams-4           9091594       27201         -99.70%