Closed HeavyHorst closed 7 years ago
The nats performance improve a lot with this little change:
I changed the sendloop in test.go to this
for i := 0; i < 10000; i++ { msg := []byte(fmt.Sprintf("message %d", i+1)) wg.Add(3) transport.Send("vicechannel1") <- msg transport.Send("vicechannel2") <- msg transport.Send("vicechannel3") <- msg }
to send 10000 messages instead of 100 down each channel
Before:
=== RUN TestTransport === RUN TestTransport/testStandardTransportBehaviour === RUN TestTransport/testSendChannelsDontBlock --- PASS: TestTransport (2.34s) --- PASS: TestTransport/testStandardTransportBehaviour (2.34s) --- PASS: TestTransport/testSendChannelsDontBlock (0.00s) === RUN TestReceive --- PASS: TestReceive (0.01s) === RUN TestSend --- PASS: TestSend (0.01s) PASS
After:
=== RUN TestTransport === RUN TestTransport/testStandardTransportBehaviour === RUN TestTransport/testSendChannelsDontBlock --- PASS: TestTransport (0.09s) --- PASS: TestTransport/testStandardTransportBehaviour (0.09s) --- PASS: TestTransport/testSendChannelsDontBlock (0.00s) === RUN TestReceive --- PASS: TestReceive (0.01s) === RUN TestSend --- PASS: TestSend (0.01s) PASS
Amazing.
The nats performance improve a lot with this little change:
I changed the sendloop in test.go to this
to send 10000 messages instead of 100 down each channel
Before:
After: