-
Notifications
You must be signed in to change notification settings - Fork 588
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
Do not create string objects from consumerTag, exchange and routingKey, or get them from a string cache #1233
base: main
Are you sure you want to change the base?
Conversation
I'd prefer to split off at least the confirmTag into it's own PR. (as it contains a lot of special code to handle things, simpler to review track errors) The other two are so similar that they can remain in this one. As mentioned in the issue, I think we should look into also providing new API that take ROM for the exchangeName/RoutingKey |
I do not have a strong opinion on whether this should be two separate PRs. However,
would be nice and can be included into this PR or a separate one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a reasonable way to reduce memory use.
I improved similarly to the .NET stream client here, avoiding tons of allocations. We need to test the PR deeply, but it makes sense to me. The problem here is the breaking changes. |
@Gsantomaggio We are using this PR in our application since almost a year ago without any problem... Today I only updated it to the latest code. (nothing else changed in this PR) |
@zgabi thank you! We appreciate you keeping this PR up-to-date. As you can see, we're making progress on version 7.0. |
@lukebakken Could you please run the build again, there was a problem in the APIApproval file |
Well, it's going to take some time to resolve conflicts with the current state of @zgabi - if you have time to start resolving conflicts, I'd appreciate it. |
Sure, that's what I ment by stating to make it much clearer what to pass. It depends in the end what the goal is:
|
I'll run some performance tests. I don't think I have access to memory profiling tools to see how this PR affects allocations ... @zgabi ? |
`AutorecoveringChannel` `CloseAsync` should just call `_innerChannel.CloseAsync`
fdaddd9
to
2320480
Compare
Sometimes, minimal local extra work/complexity avoids extra processing, allocations, GC work. It really needs to be measured. |
Here is what I see when comparing allocations between the Running from the command line, each branch appears to take about the same amount of time. Memory usage appears to be about the same. @zgabi @bollhals @paulomorgado thoughts? Right now I don't really see a reason to include this PR in version 7 and would happily move it to version 8 (where taking allocations into account will be a first-class priority).
|
@lukebakken, I haven't looked at the If the One of the benefits of I find very worrying the existence of What is |
That's the point of this PR, to reduce string allocations when this library handles
That's easy to fix. Visual Studio "helpfully" suggested adding a
|
Noticed by @paulomorgado in #1233
Noticed by @paulomorgado in #1233
Hi @lukebakken
As you pointed out, the only change is the reduced number of So, what's the benefit here? Is it the tests that are not taking advantage of this?
So, it's kind of a queue, but you need to remove items from both ends and, sometimes, anywhere. Is that it? |
Noticed by @paulomorgado in #1233
@zgabi - if you have time, please read @paulomorgado's observations:
I am running the At this point I'm getting the feeling like I'm testing this incorrectly, perhaps? |
Reducing the allocations reduces the GC overhead only. |
I'm assuming the same test conditions, otherwise the tests are not comparable. |
Hi everyone - In the interest of shipping v7 of this library this month, I am leaning towards moving this PR to version 8. I am going to release RC1 of version 7 by the end-of-day tomorrow, June 4th, 2024, so if someone has a very strong opinion about why this PR should be in version 7, comment here. |
I haven't had the time to look into it properly. If this still allows the user to use |
There would still have to be work in the API to keep it consistent. Given the time constraint and what I've seen in testing it doesn't seem like the benefit is worth further delay of v7. I still have quite a few issues to get through in the milestone (https://github.com/rabbitmq/rabbitmq-dotnet-client/milestone/53) |
Shiping is also a feature, right? If there are doubts, it should be postponed. If it is just additive for the API point of view, it doesn't need to be a new major version. |
Proposed Changes
See issue #1231
Types of Changes
What types of changes does your code introduce to this project?
Checklist
CONTRIBUTING.md
document