riscv-forks / electron

[WIP] electron for riscv64
https://electronjs.org
5 stars 3 forks source link

[electron26] Severe performance regression when running Code OSS #1

Closed kxxt closed 5 months ago

kxxt commented 5 months ago

When running Code OSS with electron 26, 27 and 28, a severe performance regression renders it unusable.

Performance results:

code-oss 1.79 with  electron22: performance is normal
code-oss 1.83 with  electron25: performance is normal
code-oss 1.83 with  electron26: performance regressed
code-oss 1.88 with  electron28: performance regressed
vscodium 1.88 with  electron27: performance regressed
vscodium 1.88 with  electron28: performance regressed

It appears that we need to bisect [electron25.9.8, electron26.6.7] (corresponds to [chromium 114, chromium116]) to find the problematic commit.

kxxt commented 5 months ago

electron v26.0.0 (chromium 116, swiftshader llvm 16) is bad electron v26.0.0-nightly.20230524 (chromium 115, swiftshader llvm 10) is bad

kxxt commented 5 months ago

electron v26.0.0-nightly.20230510 (chromium 114, swiftshader llvm 10) is good (but this build crashes frequently).

Bisection range shrink to v26.0.0-nightly.20230510..v26.0.0-nightly.20230524 (chromium 114.0.5719.0..115.0.5786.0).

kxxt commented 5 months ago

electron v26.0.0-nightly.20230510r1 (chromium 115.0.5760.0, swiftshader llvm 10) is good.

Bisection range is shrinked to v26.0.0-nightly.20230510r1..v26.0.0-nightly.20230524 (chromium 115.0.5760.0..115.0.5786.0).

kxxt commented 5 months ago

electron v26.0.0-nightly.20230523 (chromium 115.0.5760.0, swiftshader llvm 10) is good.

The bisection of electron is almost done. It's mostly confirmed that the bad commit is in chromium 115.0.5760.0..115.0.5786.0.

The next step is to bisect chromium.

kxxt commented 5 months ago

electron v26.0.0-nightly.20230523cr5773.5 (chromium 115.0.5773.5, swiftshader llvm 10) is good.

kxxt commented 5 months ago

electron v26.0.0-nightly.20230523cr5778.0 (chromium 115.0.5778.0, swiftshader llvm 10) is bad. electron v26.0.0-nightly.20230523cr5776.0 (chromium 115.0.5776.0, swiftshader llvm 10) is good. electron v26.0.0-nightly.20230523cr.d7b8251eecba3 is good. electron-v26.0.0-nightly.20230523cr.cf83bbaf3d150 is good. electron-v26.0.0-nightly.20230523cr.8d2a7df7515e7 is bad. electron-v26.0.0-nightly.20230523cr.59ee43fe7a7c4 is bad. electron-v26.0.0-nightly.20230523cr.6a609fb2d6c29 is bad. electron-v26.0.0-nightly.20230523cr.c1e4fa961824b is good. electron-v26.0.0-nightly.20230523cr.c78c1a491fa10 is good. bisection range: chromium (c78c1a491fa10..6a609fb2d6c29)

electron-v26.0.0-nightly.20230523cr.6a609fb2d6c29 (v8 11.5.138 revision 0f44e4c2a6fe21c4ef4cf1f1fba2aa145209d91d) is bad. electron-v26.0.0-nightly.20230523cr.64570d53f431b (v8 11.5.137 revision 5e9b891a870ace09011d19c21da997ad86333d77) is good.

The bisection of chromium is done. The bad commit is 6a609fb2d6c29f25c2dbce26afa165c0e80f4768:

commit 6a609fb2d6c29f25c2dbce26afa165c0e80f4768
Author: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Date:   Wed May 17 17:38:50 2023 +0000

    Update V8 to version 11.5.138.

    Summary of changes available at:
    https://chromium.googlesource.com/v8/v8/+log/5e9b891a..0f44e4c2

    Please follow these instructions for assigning/CC'ing issues:
    https://v8.dev/docs/triage-issues

    Please close rolling in case of a roll revert:
    https://v8-roll.appspot.com/
    This only works with a Google account.

    CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux-blink-rel
    CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux_optional_gpu_tests_rel
    CQ_INCLUDE_TRYBOTS=luci.chromium.try:mac_optional_gpu_tests_rel
    CQ_INCLUDE_TRYBOTS=luci.chromium.try:win_optional_gpu_tests_rel
    CQ_INCLUDE_TRYBOTS=luci.chromium.try:android_optional_gpu_tests_rel

    R=hablich@chromium.org,vahl@chromium.org,v8-waterfall-sheriff@grotations.appspotmail.com

    Change-Id: Ib5f6f43ba7ecbbbbc93867850d149a52bd692483
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4544498
    Bot-Commit: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
    Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
    Cr-Commit-Position: refs/heads/main@{#1145460}

 DEPS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

The next step is to bisect v8: https://chromium.googlesource.com/v8/v8/+log/5e9b891a..0f44e4c2

kxxt commented 5 months ago

electron v26.0.0-nightly.20230523cr.6a609fb2d6c29.v8.8d8a6c1 is good.

V8 commits left to bisect:

f6d1991 [riscv] Implement probe mmu mode by Lu Yahan · 1 year, 1 month ago
004ee17 [heap] Remove dead code from sweeper by Omer Katz · 1 year, 1 month ago

I am almost certain f6d1991 is the bad commit by looking at the code.

kxxt commented 5 months ago

electron-v26.0.0-nightly.20230523cr.6a609fb2d6c29 (v8 11.5.138) with patch https://github.com/riscv-forks/electron/commit/4195a2b3ebfb7873498df32f49e58537759fbfb8 is good.

kxxt commented 5 months ago

Upstream V8 patch: https://chromium-review.googlesource.com/c/v8/v8/+/5612950

Fixed in v29.4.0.riscv2, v29.4.2.riscv2, v30.1.0.riscv2, v30.1.0.riscv2, v27.3.11.riscv2, v26.6.10.riscv2, v28.3.3.riscv2