New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Electron: crash reporter slows down startup #120902
Comments
Hm, maybe this is a red herring: we do start the crash reporter before the
|
I believe this is much worst than we initially though, esp. on mac. For that, even the 50th percentile is close to half a second. p90 is bad on windows and really bad on mac, only linux seems to be fine. I would suggest to understand why it is so slow and/or disable the crash reporter by default. Today we are paying a very high price for it being always on |
I added it as topic to discuss for our next Electron sync 👍 |
I looked into this a while back, this is purely cost from the crashpad native component initialization https://github.com/chromium/crashpad/blob/master/doc/overview_design.md#the-crashpad-client, there is no additional cost from vscode or electron. I will get the numbers again from a minimal electron app to confirm the above details. |
I think I had asked this before: is it a design limitation of the crash handlers that we cannot start the crash reporter after the window has opened? It would be great if the crash reporter could observe existing processes after they have been created instead of requiring it to be started first. |
It is a design limitation from crashpad. For ex: the mach port created on macOS is only done once and registered on the main process, this is because the OS will take care of inheriting this port to all child processes spawned from it, thereby making it easier for the crashpad handler to monitor all processes without additional effort. Starting the crash reporter in a later stage would not work with this modal to monitor existing processes. |
Given it has such negative impact on users we consider to
|
Maybe one idea is to have it only enabled for our insider users? That is still an OK number of users (>30k?) and would still give us a chance to see a trend of crashes over time. |
I wonder if electron/electron#34609 has addressed this. |
Yes it will shave off some considerable milliseconds which are responsible for spawning the crashpad process, so we will see some improvements with that PR. |
The author states that there is even more room for improvement but the second PR is pending: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3711503 |
Anyway, this is still somewhat slow on Windows, and |
Is that windows or mac? |
Yeah I updated the comment: it was macOS and the perf gains are macOS only unfortunately. |
Disabling crash reporter on Windows seems to bring a |
@bpasero Can you check locally? E.g does that build run faster on your machine too? |
@jrieken it is actually more significant on my machine, Btw we have the duration as a telemetry mark and also show it in the startup editor: We can probably measure in Kusto what users on Windows see on average for crash reporter startup. The marks are |
Yeah, perf-tics for the perf-machine show that it is at ~30ms. Quite stable and the exploration runs where it was disabled also show nicely |
👍 , one thing to note is that crash reporter starts before |
There have been improvements with crashpad launching times in upstream electron/electron#34609, closing as we don't plan to disable crash reporter and investigating other areas in startup for perf gains. |
There is a new perf mark to measure the impact of the crash reporter on the startup which is a sync blocking call.
Even on my fast macOS ARM machine, this seems to consume a considerable amount of time:
Given the crash reporter does not provide any async API, I see no good way of fixing this unless we can start the crash reporter after the window has opened, which I think is not an option?
//cc @jrieken
The text was updated successfully, but these errors were encountered: