New issue
Advanced search Search tips

Issue 5042 link

Starred by 1 user

Issue metadata

Status: Fixed
Closed: May 2016
HW: All
NextAction: ----
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, May 25 2016

Issue description

Version: 229b66a5176e3d9b5bdf067fa53c6d4f3a00ce12
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:
At the moment, Node.JS/V8 show up as performance outlier on this benchmark
because of, what I assume is a performance bug.
13.7 KB View Download
13.9 KB View Download
Components: Compiler
Labels: Performance
Status: Available (was: Untriaged)
Labels: -Type-Bug Crankshaft HW-All OS-All Type-FeatureRequest
Status: Started (was: Available)
Project Member

Comment 3 by, May 31 2016

The following revision refers to this bug:

commit 1f51868401a61b2fa19798e866a5a184e0226948
Author: bmeurer <>
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.
BUG= v8:5042 

Cr-Commit-Position: refs/heads/master@{#36612}


Status: Fixed (was: Started)

Comment 5 by, May 31 2016

Thank you, I can confirm that the issue is fixed.
Labels: Priority-2

Sign in to add a comment