Perfect, thanks! So yes, each call to [`ReadInternetOption`](https://searchfox.org/mozilla-central/rev/d6d8fcc22c3820f2ae08229e0d37be19fba74db9/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp#58) seems to take 109ms, and since we do at least one per URL, the PAC events stack up. There is a surprising amount of `InitOnceExecuteOnce` calls on the thread that decidedly do not execute once... but every time. WININET.dll is re-initializing two structures over and over again. Naively, it seems that caching the result of `ReadInternetOption` for a certain time would work around this problem.
Bug 1652083 Comment 33 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Perfect, thanks! So yes, each call to [`ReadInternetOption`](https://searchfox.org/mozilla-central/rev/d6d8fcc22c3820f2ae08229e0d37be19fba74db9/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp#58) seems to take 109ms, and since we do at least one per URL, the PAC events stack up. There is a surprising amount of `InitOnceExecuteOnce` calls on the thread that decidedly do not execute just once... but every time. WININET.dll is re-initializing two structures over and over again. Naively, it seems that caching the result of `ReadInternetOption` for a certain time would work around this problem.
Perfect, thanks! So yes, each call to [`ReadInternetOption`](https://searchfox.org/mozilla-central/rev/d6d8fcc22c3820f2ae08229e0d37be19fba74db9/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp#58) seems to take 55ms, and we seem to do two of them per URL. There is a surprising amount of `InitOnceExecuteOnce` calls on the thread that decidedly do not execute just once... but every time. WININET.dll is re-initializing two structures over and over again. Naively, it seems that caching the result of `ReadInternetOption` for a certain time would work around this problem.