saritasa-nest / saritasa-dotnet-tools

Development Tools For Company'S .NET Projects.
BSD 2-Clause "Simplified" License
27 stars 13 forks source link

Expression execution instead of reflection. Design. #11

Closed Artur2 closed 7 years ago

Artur2 commented 7 years ago

Hi @krasninja , this is realization of expressions execution funcitonal. Please 👀 at design and critical points. Need to discuss about parameters catch-and-execute (now we transforming expression and need to store somewhere parameters from outer expression scope). And need to discuss about integration of this functional for existing messaging/query/command infrastructure.

Main entry point is ExpressionExecutor, which created by ExpressionExecutorFactory where all dependent components retrieved from simple IServiceProvider because i don't know which DI framework we use in future. All realization is hidden from user because it's redunant and code must be easy for use.

Arthur

Artur2 commented 7 years ago

@krasninja PR is ready for merge.

Artur2 commented 7 years ago

@krasninja , there is the result of optimization - 10 000 calls.

  1. Without reduce expression execution - ~46 seconds
  2. Method Invocation - ~47 seconds
  3. With reduce expression execution - ~52 seconds.