Open
Description
The IdResolver
and RoutingResolver
types cache lookup functions but, in doing so, cause closure classes to be allocated per document whenever we infer the Id or Route for an object instance. This is most evident during bulk operations. For example, here are the excess allocations caused by a BulkAll request that indexes 100k documents.
We should revisit the code in these resolvers to review if we can:
a) avoid capturing local variables and therefore allocating closures
b) optimise further (when the platform supports it) using IL emit etc.