Skip to content

Minimize same getter calls #346

@porunov

Description

@porunov

During mapping we call getters multiple times. For different situations I see different amount of getter calls (2-5 calls for a single field).
I case our getter has slow computation (for example, database calls, or generally complex logic) it may cause additional delays which could be omitted if we would call a getter only once.
Other possible problem which could be is unnecessary or unpredicted computation (for example, if we change something between each call of the getter method).
To mitigate this issue I would propose minimize getter calls (ideally we should call a getter only once, if it is needed).
A possible solution, could be making a variables for each mapping field of source object and destination object (optionally). After that we could use created variables instead of calling getters to retrieve the value.

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