Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential performance improvements #372

Closed
TimWSpence opened this issue Apr 19, 2022 · 2 comments
Closed

Potential performance improvements #372

TimWSpence opened this issue Apr 19, 2022 · 2 comments

Comments

@TimWSpence
Copy link
Contributor

We should investigate the usage of LinkedBlockingQueue - I believe that that queue is used in SPSC mode in which case the locking behaviour is a massive overhead. There are a few options floating about in the ecosystem (potentially one about to land in cats effect IIRC) that should be much more performant when combined with a dispatcher to run the enqueue actions

@bastewart
Copy link
Contributor

Discussed offline but I have always been keen to move towards an fs2.Queue. It would need an unsafeRunSync to add elements to this queue, but that should be fine as the thread where that operation occurs is managed by the Google PubSub library and is designed to block to give backpressure.

Based on memory of conversations (@TimWSpence would remember better probably!) we think that it'd be better to unsafely enqueue (multiple threads) and safely dequeue (single thread) than the other way round. I may have remembered that wrong though. Also benchmarks would show us the right answer...

@alejandrohdezma
Copy link
Contributor

Closing this as it may no longer be an issue with the new library since we are using Channel instead

@alejandrohdezma alejandrohdezma closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants