Project: v8 Issues People Development process History Sign in
New issue
Advanced search Search tips
Starred by 1 user
Status: Fixed
Owner:
Closed: May 2016
Cc:
Components:
HW: All
OS: All
Priority: 2
Type: FeatureRequest



Sign in to add a comment
Reading of write-once variables set to null causes performance overhead
Reported by stm...@gmail.com, May 25 2016 Back to list
Version: 229b66a5176e3d9b5bdf067fa53c6d4f3a00ce12
OS: OS X
Architecture: x86-64

Reading of write-once variables, initialized with `null` results in unexpected
performance overhead in the classic Richards benchmark.

Using `var NO_TASK = null, NO_WORK = null;` and then using `NO_WORK` or `NO_TASK`
instead of a literal `null` cause about 20% performance overhead.

What steps will reproduce the problem?
1. out/native/d8 richards-d8-slow.js
2. out/native/d8 richards-d8-fast.js

Expected would be identical performance, but the slow version is about 20% slower.

This code is part of a benchmarking suite aimed at comparing languages, which
is developed here: https://github.com/smarr/are-we-fast-yet
At the moment, Node.JS/V8 show up as performance outlier on this benchmark
because of, what I assume is a performance bug.
 
richards-d8-fast.js
13.7 KB View Download
richards-d8-slow.js
13.9 KB View Download
Cc: bmeu...@chromium.org verwa...@chromium.org
Components: Compiler
Labels: Performance
Status: Available
Cc: -bmeu...@chromium.org
Labels: -Type-Bug Crankshaft HW-All OS-All Type-FeatureRequest
Owner: bmeu...@chromium.org
Status: Started
Project Member Comment 3 by bugdroid1@chromium.org, May 31 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/1f51868401a61b2fa19798e866a5a184e0226948

commit 1f51868401a61b2fa19798e866a5a184e0226948
Author: bmeurer <bmeurer@chromium.org>
Date: Tue May 31 11:58:45 2016

[crankshaft] Properly optimize strict equality with constants.

For values with canonical representation (i.e. not Number, Simd128Value
or Number) we can turn a strict equality comparison to a direct pointer
comparison. This removes the weird performance cliff when using a null
or undefined constant instead of the literals.

R=jarin@chromium.org
BUG= v8:5042 

Review-Url: https://codereview.chromium.org/2027603002
Cr-Commit-Position: refs/heads/master@{#36612}

[modify] https://crrev.com/1f51868401a61b2fa19798e866a5a184e0226948/src/crankshaft/hydrogen.cc

Status: Fixed
Comment 5 by stm...@gmail.com, May 31 2016
Thank you, I can confirm that the issue is fixed.
Labels: Priority-2
Sign in to add a comment