electron/patches
Darshan Sen ec98e95b8a
fix: performance problem in crashReporter.start() on macOS (#34609)
fix: performance problem in crashReporter.start() on macOS

This change reduces the duration of crashReporter.start() on Intel macOS
from 622 milliseconds to 257 milliseconds!

Backports https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3641386

  posix: Replace DoubleForkAndExec() with ForkAndSpawn()

  The DoubleForkAndExec() function was taking over 622 milliseconds to run
  on macOS 11 (BigSur) on Intel i5-1038NG7. I did some debugging by adding
  some custom traces and found that the fork() syscall is the bottleneck
  here, i.e., the first fork() takes around 359 milliseconds and the
  nested fork() takes around 263 milliseconds. Replacing the nested fork()
  and exec() with posix_spawn() reduces the time consumption to 257
  milliseconds!

  See https://github.com/libuv/libuv/pull/3064 to know why fork() is so
  slow on macOS and why posix_spawn() is a better replacement.

  Another point to note is that even base::LaunchProcess() from Chromium
  calls posix_spawnp() on macOS -
  8f8d82dea0:base/process/launch_mac.cc;l=295-296

  Change-Id: I25c6ee9629a1ae5d0c32b361b56a1ce0b4b0fd26
  Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3641386
  Reviewed-by: Mark Mentovai <mark@chromium.org>
  Commit-Queue: Mark Mentovai <mark@chromium.org>

Fixes: https://github.com/electron/electron/issues/34321
Signed-off-by: Darshan Sen <raisinten@gmail.com>
2022-06-20 13:31:29 +09:00
..
boringssl chore: bump chromium to 100.0.4857.0 (main) (#32419) 2022-02-09 18:58:52 -08:00
chromium fix: performance problem in crashReporter.start() on macOS (#34609) 2022-06-20 13:31:29 +09:00
devtools_frontend chore: bump chromium to 102.0.4961.0 (main) (#33091) 2022-03-24 21:39:03 -04:00
Mantle chore: bump chromium to 096e5313aaf19dfa0c4710145c34d (master) (#26535) 2020-12-14 10:57:36 -08:00
nan chore: bump chromium to 103.0.5046.0 (main) (#33906) 2022-05-17 12:48:40 -04:00
node chore: bump node to v16.15.1 (main) (#34424) 2022-06-03 16:13:27 +02:00
perfetto chore: bump chromium to 100.0.4857.0 (main) (#32419) 2022-02-09 18:58:52 -08:00
ReactiveObjC chore: bump chromium to 94.0.4584.0 (main) (#30030) 2021-07-26 09:02:16 -07:00
squirrel.mac chore: bump chromium to 104.0.5073.0 (main) (#34272) 2022-06-01 08:12:47 +02:00
v8 chore: bump chromium to 104.0.5073.0 (main) (#34272) 2022-06-01 08:12:47 +02:00
webrtc chore: bump chromium to 99.0.4767.0 (main) (#31986) 2022-01-10 17:31:39 -05:00
config.json fix: webContents.openDevTools({mode}) not working (#32829) 2022-02-17 14:59:13 +09:00
README.md docs: add a dev doc describing the patch system (#20489) 2019-10-09 14:48:09 -07:00