"galder.zamarreno(a)jboss.com" wrote : Yeah, but the problem here is that
aftewards, you're treating Primitive Object arrays as serializable and you're not
taken advantage of the same performance gains that you applied to primitive arrays.
|
| IOW, in RiverMarshaller.doWriteObject, primitive arrays are treated specially and this
is done based on class id coming BASIC_CLASSES. Now, if you don't give the same class
IDs or paralell ones to primitive object arrays (Byte[], Integer[]...etc), you're
missing out on a performance improvement gain.
|
| Currently, looks to me primitive object arrays would be treated as Serializable.
If you look in RiverMarshaller.doWriteObject() (line 382 in trunk), I check if the object
is an array. If so, the descriptor is written, which consists of a one byte marker
(ID_OBJECT_ARRAY_TYPE_CLASS) followed by the component type (which, in the case of the
wrapper classes, is treated specially so that's one more byte).
After the descriptor, the array is written which is a sequence of the objects, which in
the case of primitive wrapper objects, consists of one type byte (looked up in the type
map) followed by the literal value of that wrapper object, or one byte for null.
This isn't quite as speed- and space-efficient as a pure primitive array but it should
be pretty darn close. Also, it means that an Object[] which is filled with, say, Integer
instances will take up no more space than an Integer[]. And one byte plus the int value
is just about as dense as I can make this, since each value might be null as well.
I don't see how I can really improve on this, unless it's to do something funky
like use a bit vector to mark nulls and then pass in the literal values. But I don't
think that'd be worth the gain.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4221591#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...