Closed theobalestra closed 1 year ago
Caching assembly version seems to be a good idea rather than making call every time. Needs review with the team.
@mojotheo Thanks for opening the issue. Would you be willing to contribute a PR to fix the issue?
@ashishdhingra Yep! Here you go: https://github.com/aws/aws-sdk-net-extensions-cognito/pull/108
@ashishdhingra When do you expect the team to have a path forward with this? We need to know if we should pursue a work around in the mean time.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
We’ve noticed some issues with the AWS Cognito Dotnet Library in terms of performance. We were having some performance issues on our server, and upon investigation, every Cognito call that we make calls a function![Cognito Flame Graph](https://user-images.githubusercontent.com/106850274/223257799-4af69ad6-017a-495f-9c45-3df4ba7dbf86.png)
CognitoAuthHelper.GetAssemblyFileVersion
that is rather expensive since it reads an Assembly to get the version and send it back to AWS for metrics. As shown in the flame graph below, it’s taking around 77ms of CPU time, (which in the case of this endpoint we make 3 cognito calls, which accounts for 90%+ of the CPU time). It also reads it every single time we make a call instead of caching the version, which would stay unchanged if the process is never restarted.Expected Behavior
Not have a CPU expensive call everytime there is a Cognito Call
Current Behavior
Every Cognito API call causes a large block when attempting to read an assembly file
Reproduction Steps
Any call to Cognito SDK will cause the issue
Possible Solution
Disable the call to get the AssemblyFileVersion, or cache the version
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
AWSSDK.Core v3.7.13.10
Targeted .NET Platform
.NET Core 3.1
Operating System and version
Windows Server 2019, Mac OS Ventura