blob: 8370c510dd9310be47fd2e6bd2645d942ebd8f24 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# muxer
Simple binary messaging protocol with multiplexing support.
[](https://pkg.go.dev/git.onurgunduz.com/muxer)
## Message structure
```
┌──────────────────────────────────────────────┐
│ length | channel ID × message type │ payload │
└──────────────────────────────────────────────┘
└─ 60-bits └─ 4-bits
```
## Benchmarks
```
goos: darwin
goarch: arm64
pkg: git.onurgunduz.com/muxer
cpu: Apple M4 Pro
BenchmarkWriter_64B-12 98590449 12.05 ns/op 5309.66 MB/s 0 B/op 0 allocs/op
BenchmarkWriter_4KB-12 14346594 80.00 ns/op 51198.63 MB/s 0 B/op 0 allocs/op
BenchmarkWriter_1MB-12 74955 15931 ns/op 65819.47 MB/s 14 B/op 0 allocs/op
BenchmarkReader_64B-12 70582526 16.24 ns/op 3941.01 MB/s 0 B/op 0 allocs/op
BenchmarkReader_4KB-12 15629764 78.92 ns/op 51903.93 MB/s 0 B/op 0 allocs/op
BenchmarkReader_1MB-12 38365 31480 ns/op 33309.32 MB/s 0 B/op 0 allocs/op
```
|