ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "steve.hostettler" <steve.hostett...@gmail.com>
Subject Re: BinaryMarshaller (micro) Benchmark shows that keepBinary is a bit slower than systematically unmarshall the object
Date Thu, 30 Aug 2018 05:50:12 GMT
Hello all,

I actually found what the problem was.

I accessed the fields of the BinaryObject in that way:


IgniteCache<Long, BinaryObject> cacheAsBinary =
cache.withNoRetries().withSkipStore().withKeepBinary();

///Do a million times
BinaryObject bo = cacheAsBinary .get(key);
Long field1 = o.field("field1");

but I should have done

IgniteCache<Long, BinaryObject> cacheAsBinary =
cache.withNoRetries().withSkipStore().withKeepBinary();
BinaryType type = instance.binary().type(ValueObject.class);
BinaryField field = type.field("field1");
///Do a million times
BinaryObject bo = cacheAsBinary .get(key);
Long field1 = field.value(bo);


Of course resolving field1 is costly. This is similar to what you do when
looking up a field using reflection.
For the record, now on the micro benchmark, get a field as binary takes half
the time of doing a full unmarsharling.





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Mime
View raw message