29949fa64f
Currently the user agent header value was created for each TokenDelegatingHandler and NordigenHttpClient. By creating the header value once, both the execution time and allocated memory for GetRequiredService<INordigenClient>() was reduced. Original: | Mean | Error | StdDev | Gen 0 | Gen 1 | Allocated | |--------- |---------:|---------:|-------:|-------:|----------:| | 33.16 us | 0.102 us | 0.090 us | 5.3101 | 0.0916 | 44 KB | After caching: | Mean | Error | StdDev | Gen 0 | Gen 1 | Allocated | |--------- |---------:|---------:|-------:|-------:|----------:| | 26.02 us | 0.091 us | 0.086 us | 4.8218 | 0.0000 | 39 KB |