mirrored from https://chromium.googlesource.com/v8/v8.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[isolate-data] Move hot fields closer to isolate_root
In generated code, we access fields inside IsolateData through the root-register. On some platforms it is significantly cheaper to access things that are close to the root-register value than things that are located far away. The motivation for this CL was a 5% difference in Octane/Mandreel scores between // Part of the stack check. cmpq rsp,[r13+0x9ea8] and cmpq rsp,[r13-0x30] // Mandreel score improved by 5%. This moves the StackGuard up to fix Mandreel. As a drive-by, also move two more fields up that are accessed by each CallCFunction. Tbr: yangguo@chromium.org Bug: v8:9534,chromium:993264 Change-Id: I5418b63d40274a138e285fa3c99b96e33a814fb1 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1751345 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Auto-Submit: Jakob Gruber <jgruber@chromium.org> Commit-Queue: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#63187}
- Loading branch information
Showing
3 changed files
with
37 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fb698ce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@schuay We’re looking into a performance regression in Node.js v12.16.0 (which bumped V8 from 7.7 to 7.8) – for ABI compatibility, we had to revert this patch in Node 12, but it seems that without it there’s about a 20 % performance drop in some scenarios.
Here’s the sample reproduction:
with Node 12.15.0:
with Node 12.16.0:
Notice how in the first output, only the first call is slower, whereas in the second output, its the first two calls – This reproduces consistently.
Do you have any idea why this commit might have such an unexpectedly large effect (especially since neither Node.js v12.15.0 nor v12.16.0 contain it), and how to investigate this further?
fb698ce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The numbers you posted for 12.15.0 and 12.16.0 are with or without the patch? Are a. the 20% perf drop without the patch and b. the perf drop after the first/second iteration related or two separate issues? Sorry, not sure I understand your post correctly :)
In any case, I don't have much more information than what is already in the commit message. One form of the stack check (with the small offset from kRootRegister) is significantly faster on some platforms. A stack check happens at function-entry, and in each loop iteration. So the effects will be particularly prominent if a function is dominated by a loop with a very short body. So I would not say the effect is "unexpectedly large".
Regarding the drop after 1/2 iterations, I can only guess it's due to a deopt or badly chosen optimization.
--trace-deopt
and--trace-opt
will tell you more.