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 27 forks source link

Remove managed reference tracking #71

Closed Martin-Molinero closed 1 year ago

Martin-Molinero commented 1 year ago

Test reproducing issue and asserting performance

from CLRImports import *

map_file_provider = LocalZipMapFileProvider()
map_file_provider.Initialize(DefaultDataProvider())
map_file_resolver = map_file_provider.Get(AuxiliaryDataKey.EquityUsa)

ae = datetime(2023, 2, 1)
tt = ""
method1 = map_file_resolver.ResolveMapFile
now = datetime.now()
for x in range(2000000):
        map_file = method1("AAPL", now)
        t = map_file.GetMappedSymbol(ae, tt)

print(f'Took: {datetime.now() - now}')

Master 27.17 27.28 27.66 PR 26.85 26.36 26.88