Skip to content

Conversation

@warappa
Copy link
Contributor

@warappa warappa commented May 21, 2025

  • Effectively revert delegate cache optimization
    • Each function instance requires its own .NET representation to handle parameters correctly (-> function environment)
  • Use a factory method to reduce System.Linq.Expression tree usage and therefore also the need for compiling them.
    • Compile an expression tree that allows to retarget a delegate to the actual Function instance (1 per AST, not per function instance).
    • Ensure returning the same delegate instance to allow for example unregistering handlers
  • Add 2 tests
    • Ensure multiple invokations using .NET interop don't cache function environment
    • Ensure multiple invokations using JavaScript-only functions don't cache function environment

@warappa warappa changed the title #2099: Fix over-caching by providing each function instance with it own interop variant #2099: Fix erroneous caching by providing each function instance with it own interop variant May 21, 2025
Copy link
Collaborator

@lahma lahma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, great job with test coverage!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants