QuantConnect / pythonnet

Python for .NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and provides a powerful application scripting tool for .NET developers.
http://pythonnet.github.io
MIT License
28 stars 26 forks source link

Bug lean 5943 generic method binding #59

Closed C-SELLERS closed 3 years ago

C-SELLERS commented 3 years ago

What does this implement/fix? Explain your changes.

Address bugs found via QuantConnect/Lean#5943

Added test cases for generics matching

Does this close any currently open issues?

QuantConnect/Lean#5943 Possibly others

Any other comments?

PythonNet Perf Testing

---------MASTER---------
Python.EmbeddingTest.TestConverter.ConvertDateTimeRoundTripPerformance(Utc)
Took: 992
Took: 896
Took: 924
Python.EmbeddingTest.TestConverter.ConvertDateTimeRoundTripPerformance(Unspecified)
Took: 551
Took: 551
Took: 580
Python.EmbeddingTest.TestConverter.ConvertDecimalPerformance
Took: 447
Took: 463
Took: 465

Python.EmbeddingTest.TestMethodBinder.NumericalArgumentMethodNumpy64FloatPerformance
Took: 313
Took: 318
Took: 349
Python.EmbeddingTest.TestMethodBinder.MethodWithParamsPerformance
Took: 558
Took: 576
Took: 587

Python.EmbeddingTest.TestMethodBinder.TestGenericBindingSpeed
N/A

----------PR-----------
Python.EmbeddingTest.TestConverter.ConvertDateTimeRoundTripPerformance(Utc)
Took: 951
Took: 973
Took: 962
Python.EmbeddingTest.TestConverter.ConvertDateTimeRoundTripPerformance(Unspecified)
Took: 564
Took: 597
Took: 583
Python.EmbeddingTest.TestConverter.ConvertDecimalPerformance
Took: 435
Took: 447
Took: 453

Python.EmbeddingTest.TestMethodBinder.NumericalArgumentMethodNumpy64FloatPerformance
Took: 328
Took: 319
Took: 318
Python.EmbeddingTest.TestMethodBinder.MethodWithParamsPerformance
Took: 591
Took: 584
Took: 569
Python.EmbeddingTest.TestMethodBinder.TestGenericBindingSpeed
Took: 2369 ms
Took: 2408 ms
Took: 2375 ms

Lean Perf

History Request Benchmark 2009
MASTER
4.34 seconds at 53k data points per second. Processing total of 228,102 data points.
4.27 seconds at 53k data points per second. Processing total of 228,102 data points.
4.22 seconds at 54k data points per second. Processing total of 228,102 data points.

PR
4.23 seconds at 54k data points per second. Processing total of 228,102 data points.
4.23 seconds at 54k data points per second. Processing total of 228,102 data points.
4.29 seconds at 53k data points per second. Processing total of 228,102 data points.

Performance testing shows no real impact 👍🏽 All test passing in Lean

Checklist

Check all those that are applicable and complete.