Webassembly slower than javascript
Reported by
hpw...@googlemail.com,
Jun 3 2018
|
|||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36 Steps to reproduce the problem: When you want to test yourself with the newlisp interpreter. Webassembly: http://ferrydb.nl/newlisp-wa/ Javascript: http://ferrydb.nl/newlisp/ Delete all code from left Panel and paste the following code: (module "qa-bench") Then press the eval-button. The right Panel will show the bench-result. What is the expected behavior? Webassembly is faster than JavaScript On Chrome 59.0.3071.109 is was 2 times faster What went wrong? Webassembly is about 8-10 times slower than JavaScript. Confirmed on: Windows 7 Chrome 67 Windows 7 CEF 66 Chromium 66.0.3359.181 on Linux Mint Did this work before? Yes 59.0.3071.109 Chrome version: 67.0.3396.62 Channel: stable OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version: Not sure about Version between 59 and 66
,
Jun 4 2018
,
Jun 4 2018
Also observed in Android with Chrome 66.
,
Jun 4 2018
Thanks for the report. I can repro the behavior on my MacBook. Wasm is about 5 times slower. @Test please bisect.
,
Jun 4 2018
Able to reproduce the issue on reported chrome version 67.0.3396.62 & latest chrome 69.0.3449.0 using Windows10,Mac 10.13.3 and Ubuntu 14.04 Hence providing the bisect information below. Bisect Info: ================ Good build: 66.0.3336.0 Bad build: 66.0.3338.0 You are probably looking for a change made after 533646 (known good), but no later than 533647 (first known bad) CHANGELOG URL: https://chromium.googlesource.com/chromium/src/+log/67c7f57d87619e98b1acf8f4e5f3367c2d567848..9633143e6f56ce1af0c5be593ff327d8c2dce540 suspect: https://chromium.googlesource.com/v8/v8/+/ca1d44e35f88ab7660f812df52c626446d106149 Reviewed-on: https://chromium-review.googlesource.com/888562 jgruber@: Please confirm the issue and help in re-assigning if it is not related to your change. Thanks!
,
Jun 4 2018
Clemens, could you take a look? I checked quickly on ToT and the wasm version takes 7x as long as the js version. The CL linked in #5 seems unrelated.
,
Jun 4 2018
I suspect 2778b46081c6db1090fad409923ec34089bfb910 (Reland "[turbofan] disable indirect jumps in Turbofan generated switches"). Will check further tomorrow.
,
Jun 4 2018
Confirmed. Enabling jump tables improves the execution time from 7-8 seconds to 700-800 milliseconds (factor 10). Assigning to Tobi, who is already working on a fix AFAIK.
,
Jun 8 2018
Issue 845851 has been merged into this issue.
,
Jun 19 2018
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/825c748113af5ba905da24befd86cdc52326bcae commit 825c748113af5ba905da24befd86cdc52326bcae Author: Tobias Tebbi <tebbi@chromium.org> Date: Tue Jun 19 14:24:00 2018 [turbofan] replace linear lookup switches with binary search Bug: chromium:849098 Change-Id: Iec81d08cf6edb6040445650cadf802a34b65b8e1 Reviewed-on: https://chromium-review.googlesource.com/1092749 Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Clemens Hammacher <clemensh@chromium.org> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org> Cr-Commit-Position: refs/heads/master@{#53843} [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/arm/macro-assembler-arm.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/arm/macro-assembler-arm.h [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/arm64/macro-assembler-arm64-inl.h [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/arm64/macro-assembler-arm64.h [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/arm/code-generator-arm.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/arm/instruction-selector-arm.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/arm64/code-generator-arm64.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/arm64/instruction-selector-arm64.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/code-generator.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/code-generator.h [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/ia32/code-generator-ia32.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/ia32/instruction-selector-ia32.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/instruction-codes.h [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/instruction-scheduler.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/instruction-selector-impl.h [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/instruction-selector.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/instruction-selector.h [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/mips/code-generator-mips.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/mips/instruction-scheduler-mips.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/mips/instruction-selector-mips.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/mips64/code-generator-mips64.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/mips64/instruction-selector-mips64.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/ppc/code-generator-ppc.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/ppc/instruction-selector-ppc.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/s390/code-generator-s390.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/s390/instruction-selector-s390.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/x64/code-generator-x64.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/compiler/x64/instruction-selector-x64.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/ia32/macro-assembler-ia32.h [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/mips/macro-assembler-mips.h [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/mips64/macro-assembler-mips64.h [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/x64/macro-assembler-x64.cc [modify] https://crrev.com/825c748113af5ba905da24befd86cdc52326bcae/src/x64/macro-assembler-x64.h
,
Jun 21 2018
,
Jun 25 2018
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/9061eca256b0c10f009e535c11a106197d6c9e16 commit 9061eca256b0c10f009e535c11a106197d6c9e16 Author: Tobias Tebbi <tebbi@chromium.org> Date: Mon Jun 25 09:05:24 2018 [turbofan] [wasm] enable switch jump tables by default With this CL, switch jump tables are enabled even with --untrusted-code-mitigations Bug: chromium:849098 Change-Id: I60545ed7bef2cd847710fd9660ef1007aac3b428 Reviewed-on: https://chromium-review.googlesource.com/1110817 Reviewed-by: Jaroslav Sevcik <jarin@chromium.org> Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#53993} [modify] https://crrev.com/9061eca256b0c10f009e535c11a106197d6c9e16/src/optimized-compilation-info.cc
,
Jun 26 2018
Does it make sense to backmerge this to 68? Does the fix in c12 have any dependent CLs?
,
Jun 26 2018
https://chromium-review.googlesource.com/c/v8/v8/+/1087468 is a dependent CL. But I think we can backmerge both.
,
Jun 26 2018
,
Jun 26 2018
This bug requires manual review: M68 has already been promoted to the beta branch, so this requires manual review Please contact the milestone owner if you have questions. Owners: cmasso@(Android), kariahda@(iOS), bhthompson@(ChromeOS), abdulsyed@(Desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jun 26 2018
CL in 12+dependent sounds fine IMO.
,
Jun 26 2018
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/892b19db8e1e72dcdae893decd622cb42eac7b45 commit 892b19db8e1e72dcdae893decd622cb42eac7b45 Author: Tobias Tebbi <tebbi@chromium.org> Date: Tue Jun 26 14:22:40 2018 Merged: [turbofan] [wasm] enable switch jump tables by default This is a backmerge of https://chromium-review.googlesource.com/c/v8/v8/+/1110817 Revision: 9061eca256b0c10f009e535c11a106197d6c9e16 BUG= chromium:849098 LOG=N NOTRY=true NOPRESUBMIT=true NOTREECHECKS=true R=titzer@chromium.org Change-Id: I6320384e499125ba3077404e8a92a8b20505a3da Reviewed-on: https://chromium-review.googlesource.com/1114964 Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/branch-heads/6.8@{#34} Cr-Branched-From: 44d7d7d6b1041b57644400a00cb3fee35f6c51b2-refs/heads/6.8.275@{#1} Cr-Branched-From: 5754f66f75136dc17b4c63fec84f31dfdb89186e-refs/heads/master@{#53286} [modify] https://crrev.com/892b19db8e1e72dcdae893decd622cb42eac7b45/src/optimized-compilation-info.cc
,
Jun 29 2018
This issue has been approved for a merge. Please merge the fix to any appropriate branches as soon as possible! If all merges have been completed, please remove any remaining Merge-Approved labels from this issue. Thanks for your time! To disable nags, add the Disable-Nags label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 2
,
Jul 3
Verified the fix on Mac 10.13.1, Windows-10 and Ubuntu 14.04 using Chrome versions Beta #68.0.3440.42 and Canary #69.0.3480.0 as per the comment #0. Attaching screen cast for reference. Observed that the web-assembly is faster. Hence, the fix is working as expected. Adding the verified labels. Note: Able to reproduce the issue on chrome version 67.0.3396.62 Thanks...!! |
|||||||||||||||
►
Sign in to add a comment |
|||||||||||||||
Comment 1 by krajshree@chromium.org
, Jun 3 2018