Hi Mythz,
The issue is in the returned HttpWebResponse object on the non-generic Get method, which is not in your tests.
As you can see in the comparisons below, the second is leaking open handles to streams, but if the streams is forcibly closed (third example) the problem is gone.
I’m not sure if this is a bug or a ‘by design’ where you assume anyone using the non-generic GET call will always read and close the stream manually. Even if the issue is by design, should disposing of the client also release the associated HttpWebResponse objects? Who is holding them all open?
var x = client.Get<string>($"/hello/{myctr}");
Total: 1623ms, Average: msec: 1.623, Response times average: 7.30
Total: 459ms, Average: msec: 0.459, Response times average: 5.185
Total: 485ms, Average: msec: 0.485, Response times average: 5.512
Total: 475ms, Average: msec: 0.475, Response times average: 5.401
Total: 448ms, Average: msec: 0.448, Response times average: 5.17
Total: 406ms, Average: msec: 0.406, Response times average: 4.706
Total: 409ms, Average: msec: 0.409, Response times average: 4.675
Total: 403ms, Average: msec: 0.403, Response times average: 4.636
Total: 410ms, Average: msec: 0.41, Response times average: 4.711
Total: 404ms, Average: msec: 0.404, Response times average: 4.63
Total: 390ms, Average: msec: 0.39, Response times average: 4.422
Total: 391ms, Average: msec: 0.391, Response times average: 4.378
Total: 405ms, Average: msec: 0.405, Response times average: 4.533
Total: 409ms, Average: msec: 0.409, Response times average: 4.56
Total: 399ms, Average: msec: 0.399, Response times average: 4.4
Total: 385ms, Average: msec: 0.385, Response times average: 4.26
Total: 391ms, Average: msec: 0.391, Response times average: 4.323
Total: 397ms, Average: msec: 0.397, Response times average: 4.424
Total: 410ms, Average: msec: 0.41, Response times average: 4.705
Total: 407ms, Average: msec: 0.407, Response times average: 4.67
Total: 401ms, Average: msec: 0.401, Response times average: 4.566
Total: 398ms, Average: msec: 0.398, Response times average: 4.535
Total: 397ms, Average: msec: 0.397, Response times average: 4.555
Total: 406ms, Average: msec: 0.406, Response times average: 4.642
var x = client.Get($"/hello/{myctr}");
Total: 1347ms, Average: msec: 1.347, Response times average: 15.712
Total: 569ms, Average: msec: 0.569, Response times average: 6.593
Total: 521ms, Average: msec: 0.521, Response times average: 5.927
Total: 519ms, Average: msec: 0.519, Response times average: 5.903
Total: 547ms, Average: msec: 0.547, Response times average: 6.385
Total: 665ms, Average: msec: 0.665, Response times average: 7.726
Total: 748ms, Average: msec: 0.748, Response times average: 8.78
Total: 878ms, Average: msec: 0.878, Response times average: 10.481
Total: 1034ms, Average: msec: 1.034, Response times average: 12.676
Total: 1125ms, Average: msec: 1.125, Response times average: 13.771
Total: 1243ms, Average: msec: 1.243, Response times average: 15.28
Total: 1363ms, Average: msec: 1.363, Response times average: 16.269
Total: 1520ms, Average: msec: 1.52, Response times average: 18.139
Total: 1598ms, Average: msec: 1.598, Response times average: 19.01
Total: 1669ms, Average: msec: 1.669, Response times average: 20.094
Total: 1804ms, Average: msec: 1.804, Response times average: 21.617
Total: 1938ms, Average: msec: 1.938, Response times average: 23.273
Total: 2009ms, Average: msec: 2.009, Response times average: 24.741
Total: 2240ms, Average: msec: 2.24, Response times average: 27.682
Total: 2292ms, Average: msec: 2.292, Response times average: 28.815
Total: 2451ms, Average: msec: 2.451, Response times average: 31.967
Total: 2632ms, Average: msec: 2.632, Response times average: 35.37
Total: 2807ms, Average: msec: 2.807, Response times average: 40.632
Total: 2788ms, Average: msec: 2.788, Response times average: 42.669
Total: 2909ms, Average: msec: 2.909, Response times average: 51.864
var x = client.Get($"/hello/{myctr}");
x.GetResponseStream().Close();
Total: 1719ms, Average: msec: 1.719, Response times average: 8.566
Total: 445ms, Average: msec: 0.445, Response times average: 5.103
Total: 475ms, Average: msec: 0.475, Response times average: 5.501
Total: 489ms, Average: msec: 0.489, Response times average: 5.763
Total: 452ms, Average: msec: 0.452, Response times average: 5.473
Total: 433ms, Average: msec: 0.433, Response times average: 5.249
Total: 466ms, Average: msec: 0.466, Response times average: 5.676
Total: 408ms, Average: msec: 0.408, Response times average: 4.9
Total: 411ms, Average: msec: 0.411, Response times average: 4.965
Total: 418ms, Average: msec: 0.418, Response times average: 4.984
Total: 420ms, Average: msec: 0.42, Response times average: 5.046
Total: 417ms, Average: msec: 0.417, Response times average: 5.033
Total: 407ms, Average: msec: 0.407, Response times average: 4.734
Total: 416ms, Average: msec: 0.416, Response times average: 4.796
Total: 415ms, Average: msec: 0.415, Response times average: 4.775
Total: 404ms, Average: msec: 0.404, Response times average: 4.635
Total: 413ms, Average: msec: 0.413, Response times average: 4.769
Total: 412ms, Average: msec: 0.412, Response times average: 4.724
Total: 414ms, Average: msec: 0.414, Response times average: 4.79
Total: 406ms, Average: msec: 0.406, Response times average: 4.843
Total: 409ms, Average: msec: 0.409, Response times average: 4.92
Total: 413ms, Average: msec: 0.413, Response times average: 4.998
Total: 408ms, Average: msec: 0.408, Response times average: 4.917
Total: 409ms, Average: msec: 0.409, Response times average: 4.93
Total: 404ms, Average: msec: 0.404, Response times average: 4.858