Skip to content

[4.x] Remove caching clause in FromParent resolver #1274

Open
@Kingdutch

Description

@Kingdutch

I think we can remove the explicit adding of the value to our cacheability information in

if ($value instanceof CacheableDependencyInterface) {
$context->addCacheableDependency($value);
}

Since we already do so for all the results in our field resolver

if ($result instanceof CacheableDependencyInterface) {
$field->addCacheableDependency($result);
}
$context->addCacheableDependency($field);

This may seem like a small optimisation, but when looking at a relatively complex query addCacheableDependency was actually a place where the most time was spent and I theFromParent producer is actually on a hot path because a lot of fields use the parent's value to refine it further, so removing this unneeded function call may make a difference.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions