On 7/22/16 9:40 AM, Steven Schveighoffer wrote:

On 7/21/16 8:17 PM, Steven Schveighoffer wrote:

So there are some performance issues here. If I use option 1, it's very
slow. For my dataset which has about 20,000 rows, it takes 4 seconds to
transmit the result.

For option 2, it takes 2 seconds. This doesn't make a lot of sense, I
would have expected option 1 to be faster.

I didn't record this properly. Option 2 is slower, 2.7 seconds. Option 1
is faster at 2.1 seconds.

But there is definitely no way this should be so slow. I'd expect
something near the 400ms. Investigating some more.

More info: It's not the json parser.

I parse all the objects to an Appender instead of the stream, and it's
still slow (~2s) when I write the Appender data to the stream. However,
if I just throw away the data from the appender, and then just send
"[]", the time taken is 500ms.

Something in writing the data using the bodyWriter is making this really
really slow.

If I put all the data into the appender, and then write that, the speed
is around 500-600ms. But obviously, I don't want to do that.

-Steve