Releases: ostcar/topic
v0.7.0
Split Receive
What's Changed
Full Changelog: v0.5.0...v0.6.0
Long time no seen
Change the data structure inside the topic from a linked list to a slice.
This gives an enormous performance boost. On the old version, the
bechmark looked like this:
BenchmarkPublishWithXReceivers1-16 189544 8121 ns/op
BenchmarkPublishWithXReceivers10-16 68542 17007 ns/op
BenchmarkPublishWithXReceivers100-16 12412 112008 ns/op
BenchmarkPublishWithXReceivers1000-16 2113 831531 ns/op
BenchmarkPublishWithXReceivers10000-16 188 8549041 ns/op
BenchmarkRetrieveBigTopic1-16 6755972 168.2 ns/op
BenchmarkRetrieveBigTopic10-16 482397 2880 ns/op
BenchmarkRetrieveBigTopic100-16 47083 25480 ns/op
BenchmarkRetrieveBigTopic1000-16 3550 309143 ns/op
BenchmarkRetrieveBigTopic10000-16 381 3162213 ns/op
BenchmarkRetrieveBigTopic100000-16 55 34077880 ns/op
BenchmarkRetrieveLastBigTopic1-16 9457071 150.3 ns/op
BenchmarkRetrieveLastBigTopic10-16 9307264 148.5 ns/op
BenchmarkRetrieveLastBigTopic100-16 7967427 159.4 ns/op
BenchmarkRetrieveLastBigTopic1000-16 7454274 157.1 ns/op
BenchmarkRetrieveLastBigTopic10000-16 7685139 156.2 ns/op
BenchmarkRetrieveLastBigTopic100000-16 11034918 103.3 ns/op
With this change, the same benchmark looks like this:
BenchmarkPublishWithXReceivers1-16 190663 6490 ns/op
BenchmarkPublishWithXReceivers10-16 92685 13557 ns/op
BenchmarkPublishWithXReceivers100-16 16966 71364 ns/op
BenchmarkPublishWithXReceivers1000-16 2110 614877 ns/op
BenchmarkPublishWithXReceivers10000-16 238 4942679 ns/op
BenchmarkRetrieveBigTopic1-16 74820468 15.96 ns/op
BenchmarkRetrieveBigTopic10-16 72618871 15.91 ns/op
BenchmarkRetrieveBigTopic100-16 72100257 15.92 ns/op
BenchmarkRetrieveBigTopic1000-16 77461323 15.64 ns/op
BenchmarkRetrieveBigTopic10000-16 76357166 15.53 ns/op
BenchmarkRetrieveBigTopic100000-16 76822623 15.62 ns/op
BenchmarkRetrieveLastBigTopic1-16 72182608 15.96 ns/op
BenchmarkRetrieveLastBigTopic10-16 76935794 15.98 ns/op
BenchmarkRetrieveLastBigTopic100-16 76762269 15.92 ns/op
BenchmarkRetrieveLastBigTopic1000-16 73140235 15.49 ns/op
BenchmarkRetrieveLastBigTopic10000-16 77611089 15.81 ns/op
BenchmarkRetrieveLastBigTopic100000-16 77758965 15.57 ns/op
But this comes with a backwards incompatible change. Receive returned only unique values. Not, values that where published multiple times are also multiple times inside the returned data.
Full Changelog: v0.4.1...v0.5.0
Remove old stuff
Remove unneeded features (#16) The close channel is not needed. The same can be done by using the context when calling Recieve() The WithFirstID was a hack that is not needed anymore.
Generic
Go 1.17
Only nil on shutdown
v0.3.3 Receive no nil on empy values (#9)
Fix Release
Last release was broken
Backfix
WithStartID
Adds the option WithStartID to set a specific start id