-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Performance Issues #20
Comments
Queue implements back-pressure, pausing the current fiber when calling You can avoid this in two ways:
If you don't care about when the value is consumed, consider the first option, passing some very large integer. This will avoid even creating the Future because there's nothing to await. Give those a try and let me know if you have any luck. |
I tried (1) but now that I think about it, that's probably the issue since (IIRC, about to hop on a plane), each operation on the pipeline uses its own queue which creates back pressure. Perhaps that's what I'm seeing? |
@trowski that is indeed the issue, but it's out of my hands. Each step in the pipeline creates its own queue with a default of 0 buffer. This is a fairly significant performance impact when there is a lot of data in the pipeline. |
I pushed a branch, buffer, which adds |
This has now been released in 1.2.0. |
But @withinboredom never confirmed if the new method was actually useful? |
Ah, it's useful @Bilge! I just never came back with perf improvements because I'm in the middle of a huge refactor. FWIW, it is magnitudes faster, I just don't have a way to get hard numbers. |
I'm attempting to work on an async client to nats-php and note that the performance is pretty bad (basis-company/nats.php#62) and I've narrowed it down to the implementation of Queue and Pipelines. In fact, the more steps? is on a pipeline, the worse performance it appears to get:
Before adding ->concurrent()
After:
Without pipeline:
(
async-background
is a pipeline driven flow)Should this be expected or is there some way to improve the performance?
The text was updated successfully, but these errors were encountered: