Skip to content

Releases: talostrading/sonic

v0.9.2

27 Nov 14:44
Compare
Choose a tag to compare

v0.9.1

27 Nov 13:57
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.9.0...v0.9.1

v0.9.0

15 Nov 12:55
Compare
Choose a tag to compare

What's Changed

Changes related to the correctness of IO:

  • The per async-object stackframe counter dispatched is now in IO. As such, there is one such counter shared between all async-objects sharing an IO.
    • This counter ensures we don't overflow the stack when multiple async reads/writes can be immediately completed by an async-object. When this happens, we keep building up stackframes by invoking callbacks within callbacks. We limit the stackframe count to 32 by default. Once we hit the limit, even if an async read can be done immediately, we schedule it to be completed asynchronously. This pops all stackframes.
    • The problem arises when two or more objects build up each other's stackframes. Since the counter is per async object, we can run into a case like the following:
      • on each async read, object 1 invokes an async read for object 2
      • on each async read, object 2 invokes an async read for object 1
      • all reads can be done immediately
      • We only pop the stackframes once both objects hit their limit, since the counter is per object. That means we schedule immediate async reads for later only after our stack has grown by 64 frames, even though the limit is 32.
      • With n objects, we stop at n * 32 stack frames. If n is large, we get a stack overflow
      • By sharing the counter between all objects, we ensure we never build up more than 32 stackframes, no matter the value of n. See TestDispatchLimit in conn_test.go for an example.
      • The counter is now called Dispatched and lives in the IO struct.

Performance improvements:

  • file.go is alloc-free. That makes all TCP/UDP connections alloc-free. Instead of allocating a read/write handler on each async read/write, we allocate it once at connection init time and ensure we reset the handler's state at the start of each read/write. See fileReadReactor and fileWriteReactor.

Also cleaned up some of the docs.

Full Changelog: v0.8.0...v0.9.0

v0.8.0

15 Nov 12:39
Compare
Choose a tag to compare

What's Changed

API changes in codec/websocket. Might affect some websocket users.

  • Removed the Stream interface. Removed the WebsocketStream struct. NewWebsocketStream now returns a Stream struct.
  • AcquireFrame is now a Stream method, not a global method anymore.
  • ReleaseFrame has been removed.
    • Users who wish to sends frames to the server must do it like so:
f := stream.AcquireFrame() // comes from a sync.Pool
f.SetFIN().SetPayload() // ...etc
stream.AsyncWriteFrame(f, ...)
// the frame is automatically released to the sync.Pool by the stream after the write completes
// the stream takes care to automatically mask the frame before sending it to the server
  • Revised the implementation of Frame
    • it is now just a type alias to a byte slice, instead of a struct with 3 members: header | mask | payload
    • the setter methods like SetFIN, SetPong etc are now using the builder pattern
  • Simplified the codec implementation. No API changes here.
  • Added SetMaxMessageSize to set the maximum message size per Stream. Previously this was a global object, so all streams respected the set size. stream.MaxMessageSize returns the currently set size - defaults to 512KB.
  • Added ValidateUTF8(bool) to optionally validate payloads as UTF-8 encoded per stream. ValidatesUTF8 returns whether validation is done on each frame or not. Not done by default. This also means SupportsUTF8 now returns true.

Full Changelog: v0.7.0...v0.8.0

v0.7.0

15 Nov 12:21
Compare
Choose a tag to compare

What's Changed

Breaking API change around the constructs in codec.go.

  • Removed BlockingCodecConn along with all its methods and constructors
  • Removed NonblockingCodecConn along with all its methods and constructors
  • The CodecConn interface is now a struct. It implements the functionality of both BlockingCodecConn and NonblockingCodecConn.
  • Users should replace BlockingCodecConn and NonblockingCodecConn with CodecConn.

Also removed the unused UDPMulticastClient interface.

Full Changelog: v0.6.1...v0.7.0

v0.6.1

15 Nov 12:16
4e1ba28
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.6.0...v0.6.1

v0.6.0

29 Sep 11:58
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.5.7...v0.6.0

v0.5.7

27 Sep 15:23
Compare
Choose a tag to compare

What's Changed

  • Introduce a circular buffer that always returns continuous chunks by @sergiu128 in #105
  • Correct verification of cpu pinning on linux by @sergiu128 in #112

Full Changelog: v0.5.6...v0.5.7

v0.5.6

21 Sep 08:56
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.5.5...v0.5.6

v0.5.5

17 Aug 14:52
Compare
Choose a tag to compare

What's Changed

  • Dynamically change a udp multicast peer's read buffer by @sergiu128 in #99

Full Changelog: v0.5.4...v0.5.5