kevin-montrose/Jil — pull request #52 by manofstick (2014-08-19 09:51:03+00:00)
Title: Unsafe _WriteEncodedString*s

Haven't attacked the Name Automata yet, but here was the mindless (yet soothing!) process of rearranging code until I got what I think is the most optimal _WriteEncodedString*. I think it is worth redoing the changes that I had in the previous attempt at _WriteEncodedString* (i.e. the one that checked if the string had no special characters in it.) but haven't done that yet.

But without that optimization, just using a buffer with single TextWriter.Write() and 'unsafe' I get similar performance results as previous Pull Request. (slightly worse)

Maybe because of the branching that I have done, it seems to have picked up a lot more change sets than I was expecting; but the files in the end result look correct.

Oh, and hopefully I got all of the 8 versions of the function correct. I'm _hoping_ that your test suite covers them all (i.e. all tests are passing) as I didn't really spend enough time on checking each version individually. If you don't have exhaustive tests over them, let me know and I'll add some.