Closed Bug 1406074 Opened 7 years ago Closed 5 months ago

Slow benchmarks for value mapping tests

Categories

(Core :: JavaScript Engine, defect, P3)

56 Branch
defect

Tracking

()

RESOLVED INCOMPLETE
Tracking Status
firefox57 --- wontfix

People

(Reporter: burton449ryo, Unassigned)

Details

(Keywords: perf)

User Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0 Build ID: 20170926190823 Steps to reproduce: The following tests returns weird benchmarks in FF v56 in 64 bits. http://jsben.ch/o0UDx Those tests just compare speed between if/else, switch case and value mapper. In all other browsers, the value mapper is the fastest, but not in FF. People from this forum https://stackoverflow.com/a/8624971/1914034 mentioned that the value mapper test was the fastest in past versions of FF. Those tests might point out that something is going wrong with FF. Actual results: The fastest test was the if/else test. Expected results: The fastest test should be the mapper test.
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
The mapper will be faster if you don't create a new object on every call/iteration - move the object literal into the global scope or something. I expect the if-else/switch to be faster than allocating a brand new object each time just to do a single lookup.
Priority: -- → P3
Keywords: perf
Severity: normal → S3
Status: UNCONFIRMED → RESOLVED
Closed: 5 months ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.