kevin-montrose/Jil — pull request #62 by manofstick (2014-09-05 10:42:27+00:00)
Title: Persisting char[] outside of function

This pull request probably shouldn't be merged in, rather just a proof of concept, I was just chopping things out to make sure I got them all. Just use it as a test platform maybe. Anyway this branch is a child of the "char array over stringbuilder" one, but I have persisted the char[] in a [ThreadStatic], which is passed into the Build function.

The results on the Benchmark seem good, and I'm guessing on any micro-benchmark that you would do it should be good as well, as we are now avoiding the extra buffer creation.

These were the results of the benchmark on my machine; you can compare them to the ones I previously posted (TL;DR; maybe shaved off another ~5%):

Deserializing
=============
Single:
Type Jil Static MS Jil Static Jil Dynamic MS Jil Dynamic
User 0.0227 0.0316
Answer 0.0995 0.1365
Question 0.6697 0.8571

Lists:
Type Jil Static MS Jil Static Jil Dynamic MS Jil Dynamic
User 0.145 0.2043
Answer 0.427 0.55525
Question 2.11765 2.66295

Dictionaries of strings to:
Type Jil Static MS Jil Static Jil Dynamic MS Jil Dynamic
User 0.721 1.02825
Answer 2.5398 3.3532
Question 9.31175 13.55035

Now the bad news is that MalformedISO8601 fails when run as part of the test suite, but passed when it is run on it's own. I'm guessing that maybe this is an indexing thing that when it isn't zero'd to being with you get some bad data being processed; but I haven't investigated yet.

Anyway; I think this is all positive, and a good path to follow down. Let me know if you want a "better" version of this (i.e. one that is optional, so that you can do your perf testing)