.Net Framework gcServer mode #2053
Unanswered
Pierre-M-A-Henry
asked this question in
Q&A
Replies: 1 comment 2 replies
-
You can explicitly specify a configuration file if you use a separate from pythonnet import load
load("netfx", domain="some_domain", config_file="some.config")
import clr
from System.Runtime import GCSettings
print(f"{GCSettings.IsServerGC=}") It doesn't, though :). One issue is easily fixed (I'll do that today), the parameters are not correctly converted. For the other one, that I don't see, why the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
We have a .Net Framework application that performs intensive calculations, and we have found that setting
gcServer="true"
in our application config file helps with performance (MS Docs).The calculations can be run via our .net API which we also use through pythonnet. However the performance/speed of execution is slower when running through python, and we suspect this is caused by gcServer mode, which we can see is not enabled when running through Python (
GCSettings.IsServerGC
return false).The .net application is multithreaded but doing nothing exotic, there is a main entry point for starting a calculation, and the execution stays in .net until it is completed (so we don't think the GIL could have anything to do with the issue).
We have previously managed to use .net binding redirects by creating a
python.exe.config
file, but setting thegcServer
mode that way does not seem to work.Any ideas on how we might be able to set
gcServer
through pythonnet?Beta Was this translation helpful? Give feedback.
All reactions