New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 703681 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug

Blocked on:
issue v8:6218



Sign in to add a comment

Very Slow Switch Case handling

Reported by nassahaw...@gmail.com, Mar 21 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0

Steps to reproduce the problem:
Run the provided testcase within the Chrome by providing a number - behavior is noticable from 3 and higher.
push "Create Code" button
push "Run Test"
The result appears on the screen.

What is the expected behavior?
The "bestcaseruns" count shows how many times the switch case which is called is successfully executed within some time, in this case the successful case is the first case (case 0)

The worstcaseruns shows how many times it is successful when the value is the last case in the switch-case block (case "length of array").

What went wrong?
Runtime increases linearly by the value requested in the switch case. 
This should not be the case and does not not happen for example in Firefox or IE.

Did this work before? N/A 

Chrome version: Version 57.0.2987.98  Channel: stable
OS Version: 6.3
Flash Version: Shockwave Flash 25.0 r0
 
Big_Switch_case.7z
1.0 KB Download
Components: -Blink Blink>JavaScript
Cc: bmeu...@chromium.org
Labels: Needs-TestConfirmation
@Chrome-TE: Please confirm and test with Chrome 56 to check if this is a regression. Afterwards please test with Chrome 58 with V8Future enabled (https://v8project.blogspot.de/2017/02/help-us-test-future-of-v8.html). I think this is going to be resolved with V8Future.

Comment 3 by ajha@chromium.org, Mar 23 2017

Cc: ajha@chromium.org
Labels: Needs-Feedback Needs-Triage-M57
Below are the test results performed as per C#2.

OS platform tested: Windows 10

Test steps followed:
=====================
1. Ran the provided testcase within the Chrome by providing a number - 4
2. Pushed "Create Code" button
3. Pushed "Run Test"
4. Noted down the result displayed on the screen.

Chrome versions              Best case runs           Worst case runs
===============              ==============           ================
56.0.2924.87                 45152                    39353
57.0.2987.110                39196                    35537
58.0.3029.33(no flag)        45927                    40617
58.0.3029.33(v8 future flag) 13070                    41730
59.0.3048.0(no flag)         13165                    63555

hablich@/bmeurer@: Could you please review the above and confirm the expected results.
Blocking: 698746
Blocking: -698746
Cc: hablich@chromium.org
Thanks.  nassahawela@gmail.com: What is the purpose of this test? How to interpret the results?
The test shows how many times in 5 seconds a loop is executed.

Inside the loop a function is called which simply adds using a switch-case to a result depending on the value provided. The switch-case block is created dynamically by the input.

In Best case runs the parameter given to the function is 0, meaning that the first one of all the cases is the successful one.
Worst case means the successful case is always last one.

Problem is, that it should not matter which one is the successful case, given it should be some kind of jump table.

Apparently it does, though, the difference is even much higher in bigger switch case blocks (>20).

Why the results are reversed in the new version, i cannot say, unfortunately.
Project Member

Comment 8 by sheriffbot@chromium.org, Mar 30 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "ajha@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: krajshree@chromium.org
Labels: -Needs-TestConfirmation Needs-Feedback
Tested the issue on Win-10 using latest canary #59.0.3056.0.

Following are the steps followed to reproduce the issue.
------------
1. Ran the provided test case within the Chrome by providing a number - 4
2. Pushed "Create Code" button
3. Pushed "Run Test"
4. Noted down the result displayed on the screen.

Results (Both canary and firefox):

Browsers behaviour            Best case runs           Worst case runs
===============               ==============           ================
Canary                          18691                      40485
Firefox                         63211                      95270

nassahawela@ - Could you please check the results in both the browsers and please update let us know the expected behavior.

Thanks...!!
firefox_behavior.JPG
123 KB View Download
canary_behavior.JPG
75.9 KB View Download
Cc: cbruni@chromium.org rmcilroy@chromium.org
Components: -Blink>JavaScript Blink>JavaScript>Compiler
Status: Available (was: Unconfirmed)
Thanks. bmeurer@ and rmcilroy@, how important is this use case?
Blockedon: v8:6218
Project Member

Comment 12 by sheriffbot@chromium.org, Apr 6 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment