I agree with this, assuming we do not require "POJO to X"
functionality (i.e. having to start with POJO).
It is not explicitly defined, but I assume this is the thinking
already, i.e. start with whatever item abstraction is used, which may
be POJO or package-generated class (for thrift, protobuf etc)
> 2) Change #1 will cause more RAM to be used. I suggest we raise the max heap
> size from 16mb to something much higher (256? 512?). GC could easily and
JVM default is 64 megs. Are we lowering it explicitly.
> silently ruin results, so we should try to avoid it. It is difficult enough
> to benchmark the serializers and get meaningful numbers, introducing such
> low memory constraints only complicates unnecessarily.
I am fine with this.
But I would want to include actual normal GC costs in measurements,
since that will be incurred for real production code as well. And
inclusion then rewards codecs that are careful to with their temporary
object creation.
I mention this as I have seen some benchmarking articles recommend
trying to remove GC overhead, which I don't agree with, at least not
as general advice.
> 3) I suggest we remove the test named "SerializeSameObject", since its sole
> purpose appears to be to serialize without the overhead that we just removed
> from "Serialize" with change #1.
Agreed. I think this was due to some codec ("optimized" protobuf by
activemq) abusing knowledge that same item was being serialized.
However, I would probably vote for just removing such codecs, to avoid
having to create fresh items.
That is, I think "new vs same" should be collated into just one test, number.
>
> 4) We have 3 tests for deserialization: Deserialize, DeserializeAndCheck,
> and DeserializeAndCheckShallow. Deserialize just does deserialization, so
> that is good. DeserializeAndCheckShallow makes a shallow copy of the
> deserialized object. What use does this metric have? DeserializeAndCheck
> makes a deep copy of the deserialized object. I believe this is done because
> protobuf/activemq+alt does lazy deserialization. Making a deep copy is quite
> a bit of overhead to add to ALL the benchmarks just so protobuf/activemq+alt
> can be included! This is very important because totalTime is computed as
> timeSerialize + timeDeserializeAndCheck, so the overhead is skewing all of
> the results. Rather than negatively affect all other results, I suggest we
> remove both DeserializeAndCheck and DeserializeAndCheckShallow, then we
> ensure that protobuf/activemq+alt calls all the getters so all
> deserialization occurs (which isn't the same as a deep copy anyway). This is
> the only way to fairly benchmark protobuf/activemq+alt along with the rest
> of the serializers. We should prominently post a message (possibly with an
> asterisk in the results numbers and charts) that explains that
> protobuf/activemq+alt supports lazy deserialization, which is a really
> awesome feature no one else has, so deserialization times could be much
> lower when using that lib.
As I said, I think we could just rm that one codec. It's not faster
than standard one anyway (except when it can optimize out calls, which
is fishy).
One more suggestion: another way to reduce relative importance of
overhead would be to increase data size. And of two dimensions
available -- making value itself bigger; using sequences of items -- I
think latter would be easier to use. Either way, ability to generate
permutations would be very useful so that we can create bigger data
sets; and vary things like inclusion of non-ASCII characters.
And the case of single item can be thought of simply as a subset of
more general sequence test... so we migth be able to automate tests of
1, 10, 100 (or such) item cases.
This has been talked about often, and I realize that if it was trivial
one of us would have done it. But I want to keep it in discussion, so
eventually someone is itching badly enough to do it. :-D
-+ Tatu +-