pieterderycke / Jace

Jace.NET is a calculation engine for the .NET platform.
MIT License
436 stars 94 forks source link

Performance Slowness #35

Closed keyneom closed 5 years ago

keyneom commented 6 years ago

Currently at the line mentioned below it can be seen that the DynamicCompiler returns a Func that makes a call to EngineUtil.ConvertVariableNamesToLowerCase. When calling Calculate on the CalculationEngine it has already converted all variable names to lowercase. Ideally, this would be a feature one could opt-out of altogether since users interested in maximizing performance might be enforcing lowercase variable names already.

https://github.com/pieterderycke/Jace/blob/f97eac1f13e5582ae8da64d55b63a19360200556/Jace/Execution/DynamicCompiler.cs#L42

If my performance metrics from a project using your nuget package are correct, ~33% of the time executing a calculation (through the CalculationEngine.Build method, so we are already avoiding the repeated call to EngineUtil.ConvertVariableNamesToLowerCase in the CalculationEngine.Calculate method) for us is taken up by ensuring that the variables are all lowercased.

pieterderycke commented 5 years ago

I have already fixed this issue in the dev branch