graphql-kafkajs-subscriptions icon indicating copy to clipboard operation
graphql-kafkajs-subscriptions copied to clipboard

Fix memory leak and improve performance

Open MP0w opened this issue 1 year ago • 1 comments

  1. unsubscribe didn't remove the index from the map
  2. subscribe needed to create an array of all keys to get the next index
  3. the map used arrays to store all indexes, replaced with a Set for faster lookup
  • Added tests before the fix to verify it still works fine
  • Tested performance of adding 100K subscribers and publishing a message: new implementation: 85ms old implementation: 120 sec

MP0w avatar Nov 06 '23 20:11 MP0w

must have closed it by mistake

MP0w avatar Nov 10 '23 12:11 MP0w