On 04/14/2009 11:52 AM, Galder Zamarreno wrote:
David M. Lloyd wrote:
> On 04/10/2009 06:43 AM, Galder Zamarreno wrote:
>> - For Beta1, I'd like David to have a look at what I've done and see
>> if he can review it...
>
> Regarding externalizers - they are potentially slightly faster than
> Externalizable due to the fact that reflection is not needed to
> construct the instance. But, I'll leave the proof of that to the
> benchmarks. :-)
That was precisely one of the questions I had for you. Which of the two
options would be faster in your opinion. I'll definitely try to test
both options.
It's really hard to say since it could even depend on the message size and
composition. I think for large messages with lots of repetitions of that
class, Exteralizers will be a little faster. For small messages with less
repetition, maybe not. The cost of sending the Externalizer instance might
outweigh the cost of the reflection invocations required to support
Externalizable. Of course if you use ObjectTable to mitigate this, then
that might tip the scale the other way.
Either one will be tons faster than Serializable though. :-)
> Otherwise it looks correct from a JBoss Marshalling perspective.
> Moving from Object*Stream to ObjectInput/Output where you can is a
> smart move in my opinion.
What's the reason your saying this?
Just because Object*Stream is a big clunky API with lots of extra, useless
junk, and instances of those classes tend to have a lot of overhead
associated with them. Using the interfaces also gives more flexibility;
and of course (Unm|M)arshaller extends Object(In|Out)put as well so you can
work with either mechanism.
- DML