Added PERF comment

This commit is contained in:
Kristian Hellang 2015-11-10 19:55:14 +01:00
parent 7b35b2e1b9
commit f726b7b591
1 changed files with 3 additions and 1 deletions

View File

@ -56,6 +56,7 @@ namespace Microsoft.AspNet.Http.Extensions
var encodedQuery = query.ToString();
var encodedFragment = fragment.ToString();
// PERF: Calculate string length to allocate correct buffer size for StringBuilder.
var length = scheme.Length + SchemeDelimiter.Length + encodedHost.Length
+ combinedPath.Length + encodedQuery.Length + encodedFragment.Length;
@ -116,6 +117,7 @@ namespace Microsoft.AspNet.Http.Extensions
var path = request.Path.Value;
var queryString = request.QueryString.Value;
// PERF: Calculate string length to allocate correct buffer size for StringBuilder.
var length = request.Scheme.Length + SchemeDelimiter.Length + host.Length
+ pathBase.Length + path.Length + queryString.Length;
@ -129,4 +131,4 @@ namespace Microsoft.AspNet.Http.Extensions
.ToString();
}
}
}
}