Inline CodecDataObject's NodeContextSuppliers

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.

Activity

Show:

Robert Varga June 16, 2021 at 9:17 AM

We have everything we need in CodecDataObjectGenerator.Fixed, but we also need instantiation information from MDSAL-669.

Robert Varga May 1, 2019 at 9:49 PM

This optimization is not valid, as it breaks the ability to transport groupings: if a grouping is used somewhere we need to rehost the NodeContextSupplier.

Hence we need to dial this optimization down, so that we understand whether a node is defined within the context of a grouping – in which case we need to fall back to name-based lookups. If a node is defined outside of a grouping, i.e. it cannot be reused, we are free to perform this optimization.

This will require some amount of refactoring to have DataObjectCodecContext the appropriate hooks to support such duality of operation.

Robert Varga April 23, 2019 at 8:24 AM

The disconnect of CodecDataObject is not complete, as we still need the DataObjectCodecContext reference for AugmentableCodecDataObject mechanics. In order to eliminate that dependency will need MDSAL-392, i.e. full visibility into all possible augmentations and their ClassLoaders. This issue will deal only with normal fields and the key() method.

Details

Assignee

Reporter

Labels

Components

Fix versions

Priority

Created April 23, 2019 at 8:02 AM
Updated June 24, 2024 at 9:00 AM
Loading...