pamidur / aspect-injector

AOP framework for .NET (c#, vb, etc)
Apache License 2.0
770 stars 115 forks source link

Feature: Can cache Argument(Source.*) any input argument by static field? #209

Open Cricle opened 1 year ago

Cricle commented 1 year ago

Describe the solution you'd like In many argument inject image

Raw method call 1_000_000 use time 00:00:00.0188756 Only target and arg inject method call 1_000_000 use time 00:00:00.0371436 With target, arg, instance, targetType, method inject method call 1_000_000 use time 00:00:00.2172970

Describe alternatives you've considered Generate a new class to store this arguments, for call method, use readonly static field.

Additional context Add any other context or code snippets about the feature request here.

pamidur commented 1 year ago

The caching is indeed a big thing. Last I looked into it - the main problem was with generic methods and types for which we can't really use cache. So to be honest, I'd like to have these things cached, but I yet to find a proper and consistent way to do it.

Contributions are welcome!