Details
-
Improvement
-
Status: Confirmed
-
Medium
-
Resolution: Unresolved
-
None
Description
The LazyDataObject->CodecDataObject refactor allows us to improve the dispatch performance as we are no longer bound by InvocationHandler API. First part of this was already done in MDSAL-442, where we are using simple integers to lookup NodeContextSupplier which handles decoding of NormalizedNode data – ditching a Map in favor of simple array.
As it turns out, though, we can do a bit better here, as CodecDataObject only needs that lookup from DataObjectCodecContext. Since the offsets are fixed anyway, we may as well generate constant fields in the CodecDataObject overlay and pass them down to CodecDataObject proper, which will then just use the constant.
This will eliminate all lookups from the hot path and use easily propagated constants instead. It will also save one field in CodecDataObject, as it will no longer require a reference to DataObjectCodecContext.