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.pull/515/head
parent
954e720837
commit
35e4dbd518
2 changed files with 17 additions and 5 deletions
Loading…
Reference in new issue