-
Notifications
You must be signed in to change notification settings - Fork 85
Refactor: pass around record of properties for operation #876
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
base: release/2.7
Are you sure you want to change the base?
Conversation
43fe93d to
5f7701a
Compare
c6b9e3f to
73d2a24
Compare
| @@ -0,0 +1,19 @@ | |||
| namespace NATS.Client.Core; | |||
|
|
|||
| public record NatsPublishProps : NatsMessagingProps | |||
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.
can we have these props as structs? we don't want to contribute to GC especially with every publish for example. Also we can't change the public interfaces (haven't seen any yet, but just in case there are changes to them)
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.
Unfortunately you can't do inheritance with structs and in a couple of locations it takes a base class. in fact the rabbitmq client uses classes for this example https://rabbitmq.github.io/rabbitmq-dotnet-client/api/RabbitMQ.Client.BasicProperties.html but given it is a DTO, a record felt more right to me and it allows properties to be updated after initialisation.
|
thanks for this @thompson-tomo had a quick scan through I appreciate your care about the public interface we have to make sure not the break existing dependencies to us. the main comment i'd have is about performance. would be good to run some of the benchmarks and my gut feeling is to have the props as structs rather than classes will probably help. edit: i just realize it's still WIP but hope it helps anyway |
|
Agree @mtmk that we need to be careful not to impact existing dependencies hence the new internal methods etc. This is almost done with the main outstanding being review of accessibility modifiers, code comments & the UNKNOWN param scenario. |
|
@mtmk So it might be difficult to get reliable benchmarks given the current setup is producing such significant variance in results but based on last results & comparing it to a test from when I cleaned up the csproj file. The throughput has increased but at the same time the memory usage also went up. At the same time the allocated memory also sharply rose but not sure if issue due to short test run. |
759a721 to
4d27a4f
Compare
4d27a4f to
ce9f4a7
Compare
e9d7c75 to
ff6e44b
Compare
6b0a882 to
5cc77bd
Compare
Signed-off-by: James Thompson <[email protected]>
Signed-off-by: James Thompson <[email protected]>
Signed-off-by: James Thompson <[email protected]>
Signed-off-by: James Thompson <[email protected]>
Signed-off-by: James Thompson <[email protected]>
Signed-off-by: James Thompson <[email protected]>
5cc77bd to
b71c161
Compare
This does some basic refactoring to prepare for #871 with the key focus being to pass record of operation properties rather than multiple variables.
As part of this change the following has been introduced:
Potential Breaking changes: