spray/spray-json — pull request #104 by tootedom (2014-05-07 23:15:19+00:00)
Title: + JsonPrinter : allow a length to be provided for string builder

Hi there,

Is it possible to allow for the specification of the size of the buffer used by the CompactPrinter and the PrettyPrinter. I noticed that the default size of 16chars is used, which causes a larger number of expansions to occur, increasing the amount memory allocations and TLAB pressure:

Here is an screen shot for a load test run of the default 16 chars

![stringbuilderexpand](https://cloud.githubusercontent.com/assets/211070/2910109/f67ee462-d63c-11e3-8fe6-78f1e8045c2b.png)

Here's the same execution, but being allowed to specify the size of the internal buffer:

![stringbuilderexpandreduction](https://cloud.githubusercontent.com/assets/211070/2910123/378a5a90-d63d-11e3-804f-7db40dd6447e.png)

----

Maybe there's another way to address the sizing of the internal buffer. But I thought I'd highlight the expandCapacity impact.

thanks
/dom