Skip to content

ExecutionResult are still being created per field #3458

@bbakerman

Description

@bbakerman

The beginField instrumentation method was deprecated during this version but for backwards compat reasons it got delegated back to and hence it was not a breaking change

default InstrumentationContext<ExecutionResult> beginField(InstrumentationFieldParameters parameters, InstrumentationState state) {

and adapter was used

    default InstrumentationContext<Object> beginFieldExecution(InstrumentationFieldParameters parameters, InstrumentationState state) {
        InstrumentationContext<ExecutionResult> ic = beginField(parameters, state);
        return ic == null ? null : new ExecutionResultInstrumentationContextAdapter(ic);
    }

but this adapter does thgis

        CompletableFuture<ExecutionResult> future = result.thenApply(obj -> ExecutionResultImpl.newExecutionResult().data(obj).build());
        delegate.onDispatched(future);
        //
        // when the mapped future is completed, then call onCompleted on the delegate
        future.whenComplete(delegate::onCompleted);

that is it creates an Er for backwards compat reasons - so in fact we are creating a ER for each field value anyway.

I think we have to bite the bullet here and NOT call the old method (backwards compat breaking change) in order to get the efficiency we want.

This means that people need to update to the new method in Instrumentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions