DESCRIPTION

SPY-58: Don't compress json objects

We don't actually parse the whole object. Instead we look
at the first character and if it looks like json then we
don't compress it.

Change-Id: If60423b56ebf22c4529bffe95496ffe8b833a65f


COMMENTS

author: Kenny Maynard
date: 2011-10-21 00:56:04.508000000

Uploaded patch set 2.

-------------------------------------
author: Andreas Short
date: 2011-10-21 05:27:00.906000000

Patch Set 2: I would prefer that you didn't submit this

(1 inline comment)

I do think it makes sense to check for an array.  The primary reason is that if any kind of JSON is expected to be big, it's mostly arrays.

I'm also slightly concerned about the test, but will try to verify.

Line:60, src/test/java/net/spy/memcached/transcoders/SerializingTranscoderTest.java -> I *think* this is okay, but did you test that the test fails without L57?  It's awfully short to be compressing, and some compression algorithms may ignore it.

-------------------------------------
author: Kenny Maynard
date: 2011-10-21 18:36:14.405000000

Patch Set 2: (1 inline comment)



Line:60, src/test/java/net/spy/memcached/transcoders/SerializingTranscoderTest.java -> I'm going to change the string being encoded to be a little more interesting, but I do want to point out that if you look at the entire encode() function in SerializingTranscoder and other class where the code was changed then you will notice that we exit from the function before even deciding whether or not to do compression.

-------------------------------------
author: Andreas Short
date: 2011-10-21 19:38:39.232000000

Patch Set 2: No score

Changing to +0

After a discussion with Mike, he's going to enhance the test just slightly with a larger object, verify that the test fails with the compression check commented out, then put the change up and mark it verified.   After that, I'll add my +2 and we'll be good to go.

-------------------------------------
