Skip to content

Improve Indicator Performance Benchmark #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Martin-Molinero
Copy link
Member

What does this implement/fix? Explain your changes.

  • Adding new interop type cache holding a bool, true if its an exception.
  • Adding a setter and getter cache for the propertyobject.

How Has This Been Tested?

Tested exeucting QuantConnect unit and regression tests and indicator performance benchmark:

[MASTER]
imagen
[PR]
imagen

[MASTER]
160.95 seconds at 5k data points per second. Processing total of 782,223 data points.
158.54 seconds at 5k data points per second. Processing total of 782,223 data points.
159.95 seconds at 5k data points per second. Processing total of 782,223 data points.
[PR]
132.27 seconds at 6k data points per second. Processing total of 782,223 data points.
130.07 seconds at 6k data points per second. Processing total of 782,223 data points.
129.88 seconds at 6k data points per second. Processing total of 782,223 data points.

[PR] has a 15-20% speed improvement.

Note
Testing showed no signficant impact on the BasicTemplateAlgorithm performance benchmark:
python_benchmark_algo.txt

Does this close any currently open issues?

Related to QuantConnect/Lean#2925

- Adding new `interop` `type` cache holding a `bool`, true if its an `exception`.
- Adding a `setter` and `getter` cache for the `propertyobject`.
var instance = Expression.Convert(obj, methodInfo.DeclaringType);

var value = Expression.Parameter(typeof(object));
var argument = Expression.Convert(value, methodInfo.GetParameters()[0].ParameterType);
Copy link
Member

Choose a reason for hiding this comment

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

Can methodInfo.GetParameters() return null or empty list?

Copy link
Member Author

Choose a reason for hiding this comment

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

Since methodInfo is the setter I don't think it should happen, but I'll add a check to be in the safe side 👍


var expressionCall = Expression.Call(instance, methodInfo, argument);

return Expression.Lambda<Action<object, object>>(
Copy link
Member

Choose a reason for hiding this comment

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

❤️

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.

3 participants