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

Use of AutoMapper in Discount Grpc #23

Closed
DavidAJohn opened this issue Apr 19, 2024 · 1 comment
Closed

Use of AutoMapper in Discount Grpc #23

DavidAJohn opened this issue Apr 19, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@DavidAJohn
Copy link
Owner

DavidAJohn commented Apr 19, 2024

While updating the version of AutoMapper used in parts of the application (in order to switch to the non-DI v13> package), it occurred to me that perhaps the Discount Grpc project should be using a custom mapper class instead - which should be quicker (but slightly less convenient).

Otherwise, we're potentially losing part of the speed advantage that Grpc offers.

@DavidAJohn DavidAJohn added the enhancement New feature or request label Apr 19, 2024
@DavidAJohn DavidAJohn self-assigned this Apr 19, 2024
@DavidAJohn DavidAJohn pinned this issue Apr 19, 2024
@DavidAJohn
Copy link
Owner Author

The Basket API also uses AutoMapper when updating (or POSTing to) a customer basket.

It uses a call to the Discount Grpc service to retrieve any current discounts for a particular product when it is added to a basket.

Testing in Postman, I found that with 2 items in a basket the request was completing in anywhere from 125ms to 288ms.

It would be interesting to see how much could be shaved off that by using what would be a very simple, one-way custom mapper class instead of AutoMapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant