You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Performance] Make serialization support enabled optionally #1781
With the objective of achieving the fastest pythonnet as possible, we've detected that there's a significant performance hit with the serialization feature. Specifically we saw the following pain points but there might be more:
I suppose the HashSet involvement can be put behind a boolean flag like Runtime.Dangerous.AllowUndefinedShutdownBehavior. Without it the process may crash with segfault when Python or .NET runtime is unloaded when the process is stopping. Alternatively, you may try to re-engineer that bit to use a more performant collection, like a linked list. You would likely have to store some data on the Python side though.
At the first glance the MaybeType <-> Type conversions could be restricted to SaveRuntimeData and RestoreRuntimeData, and the type of cache set to Dictionary<Type, PyType>.
Activity
lostmsu commentedon May 2, 2022
I suppose the HashSet involvement can be put behind a boolean flag like
Runtime.Dangerous.AllowUndefinedShutdownBehavior. Without it the process may crash with segfault when Python or .NET runtime is unloaded when the process is stopping. Alternatively, you may try to re-engineer that bit to use a more performant collection, like a linked list. You would likely have to store some data on the Python side though.At the first glance the MaybeType <-> Type conversions could be restricted to
SaveRuntimeDataandRestoreRuntimeData, and the type ofcacheset toDictionary<Type, PyType>.PRs are welcome.