Replace per-message async fire-and-forget with direct-buffer write loop mirroring NatsClient pattern: SpinLock-guarded buffer append, double- buffer swap, single WriteAsync per batch. - MqttConnection: add _directBuf/_writeBuf + RunMqttWriteLoopAsync - MqttConnection: add EnqueuePublishNoFlush (zero-alloc PUBLISH format) - MqttPacketWriter: add WritePublishTo(Span<byte>) + MeasurePublish - MqttTopicMapper: add NatsToMqttBytes with bounded ConcurrentDictionary - MqttNatsClientAdapter: synchronous SendMessageNoFlush + SignalFlush - Skip FlushAsync on plain TCP sockets (TCP auto-flushes)
17 lines
689 B
C#
17 lines
689 B
C#
namespace NATS.Server.Benchmark.Tests.Infrastructure;
|
|
|
|
[CollectionDefinition("Benchmark-Core")]
|
|
public class BenchmarkCoreCollection : ICollectionFixture<CoreServerPairFixture>;
|
|
|
|
[CollectionDefinition("Benchmark-JetStream")]
|
|
public class BenchmarkJetStreamCollection : ICollectionFixture<JetStreamServerPairFixture>;
|
|
|
|
[CollectionDefinition("Benchmark-Mqtt")]
|
|
public class BenchmarkMqttCollection : ICollectionFixture<MqttServerFixture>;
|
|
|
|
[CollectionDefinition("Benchmark-Tls")]
|
|
public class BenchmarkTlsCollection : ICollectionFixture<TlsServerFixture>;
|
|
|
|
[CollectionDefinition("Benchmark-WebSocket")]
|
|
public class BenchmarkWebSocketCollection : ICollectionFixture<WebSocketServerFixture>;
|