• Jon Skeet's avatar
    Improve string encoding times. · 35e4dbd5
    Jon Skeet authored
    Cache a reference to Encoding.UTF8 - the property access is (rather surprisingly) significant.
    Additionally, when we detect that the string is all ASCII (due to the computed length in bytes being the length in characters), we can perform the encoding very efficiently ourselves.
    35e4dbd5
CodedOutputStream.cs 44.1 KB