Improve Uri.UnescapeDataString codepath -> UriHelper.UnescapeString #20177
Labels
area-System.Net
enhancement
Product code improvement that does NOT require public API changes/additions
help wanted
[up-for-grabs] Good issue for external contributors
tenet-performance
Performance related issue
Milestone
After doing an investigation on some performance traces collected from some mvc aspnet applications scenarios we found that a considerable amount of
char[]
objects were allocated on the GC Heap which are coming fromUri.UnescapeDataString
codepath that is callingUriHelper.UnescapeString
(source code) which receives achar[]
as the destination of the unescaped string and then creating a string from thatchar[]
.I know it would be a big change but we could probably consider using the sourceString that is already allocated or using a
PooledStringBuilder
which uses anArrayPool
for the buffer cache as explained here:/cc @danmosemsft @jkotas @stephentoub
The text was updated successfully, but these errors were encountered: