Skip to content

Cached mappers potentially traverse expressions multiple times in different function contexts #544

Description

@majosm

Currently, cached mappers clone themselves with a fresh cache when encountering a function definition. This means that if an expression appears both inside and outside the function, it will be traversed twice. Potentially this could be avoided by caching globally, but currently this can't be done because Placeholders are not globally unique (e.g., a placeholder coming from compilation or from a parent function may have the same name as an argument to the current function, making the two equal even though they represent different things). It might be possible to tag placeholders with the function context somehow in order to make them unique, but I don't currently know of a 100% reliable way to do that.

(@inducer Just summarizing what we talked about at the meeting this morning so I don't forget.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions