nats-io / nats.swift

Swift client for NATS, the cloud native messaging system.
Apache License 2.0
22 stars 4 forks source link

Added batch write buffer #50

Closed mtmk closed 7 months ago

mtmk commented 7 months ago

Tests below were run against nats bench:

nats bench x --sub 1 --msgs 1000000

nats bench

nats bench x --pub 1 --msgs 1000000

Sub stats: 1,457,860 msgs/sec ~ 177.96 MB/sec

with batch

swift run -c release bench pub x 1000000

Sub stats: 148,782 msgs/sec ~ 18.16 MB/sec

with batch disabled

swift run -c release -Xswiftc -DSWIFT_NATS_BATCH_BUFFER_DISABLED bench pub x 1000000

Sub stats: 18,998 msgs/sec ~ 2.32 MB/sec