[API Proposal]: Add StringBuilder overload for WebUtility.HtmlEncode #109591
Labels
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
area-System.Net
untriaged
New issue has not been triaged by the area owner
Background and motivation
I suggest adding
StringBuilder
overloads in WebUtility similar toTextWriter
one. Actually one very similar already exists for private implementation.Motivation: in Oxpecker framework (which is currently one of the top frameworks at Techempower benchmarks) I'm using
StringBuilder
for ViewEngine rather thanTextWriter
because it gives about 10% performance increase for rendering HTML views to string. One downside is thatHtmlEncode
method doesn't allow for StringBuilder, so I'm allocating strings each time encoding is required.If overload is added, it can behave faster than
TextWriter
since no intermediateValueStringBuilder
instances are requried.API Proposal
API Usage
Alternative Designs
No response
Risks
No response
The text was updated successfully, but these errors were encountered: