You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. Thank you for this library. I have been experimenting with it and love the API. However, I've come up against some pretty significant performance issues when compared to using amqplib directly. I've tried to simply this as much as possible to demonstrate the issue.
If I use the amqpbus library with the following code, I'm achieving about 50 messages per second. Note that if I increase the number inside of range() to 1000000, I get an out of memory error:
importAmqpBusfrom'amqpbus';import{range}from'lodash';constbus=newAmqpBus('amqp://guest:[email protected]:32780',()=>{conststream=bus.getStream('PUSH','amqpbus');range(100000).forEach((item)=>stream.send({message: `This is message number ${item}`}));});
However, with the following code using amqplib directly, I'm able to get 50,000 messages per second:
importamqplibfrom'amqplib';import{range}from'lodash';amqplib.connect('amqp://guest:[email protected]:32780').then((conn)=>{returnconn.createChannel();}).then((ch)=>{constq='amqplib';ch.assertQueue(q,{durable: true});range(1000000).forEach((item)=>ch.publish('',q,Buffer.from(JSON.stringify({message: `This is message number ${item}`}))));});
I'm not sure if this has to do with all of the Event emitting or what.
The text was updated successfully, but these errors were encountered:
Thanks for reporting the issue. I have not encountered this before, but I will test it asap and get back to you.
At first look it seems that the send method connects to the server on every call and asserts the existence of the queue before sending the message. That is indeed a performance drain and should only be done the first time it connects to the stream.
Hello. Thank you for this library. I have been experimenting with it and love the API. However, I've come up against some pretty significant performance issues when compared to using
amqplib
directly. I've tried to simply this as much as possible to demonstrate the issue.If I use the
amqpbus
library with the following code, I'm achieving about 50 messages per second. Note that if I increase the number inside of range() to 1000000, I get an out of memory error:However, with the following code using
amqplib
directly, I'm able to get 50,000 messages per second:I'm not sure if this has to do with all of the Event emitting or what.
The text was updated successfully, but these errors were encountered: