Open Bug 1818830 Opened 2 years ago Updated 2 years ago

escape() from react-dom seems slower in SM than V8 and JSC

Categories

(Core :: JavaScript Engine, enhancement, P1)

enhancement

Tracking

()

People

(Reporter: jrmuizel, Assigned: dthayer)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sp3])

Attachments

(1 file)

(deleted), application/x-javascript
Details
Attached file escape.js (deleted) —

escape:

function escape(key) {
    var escaperLookup = {
        "=": "=0",
        ":": "=2"
    };
    return "$" + ("" + key).replace(/[=:]/g, function(match) {
        return escaperLookup[match];
    });
}

On the attached benchmark I get:
SM w/ spectre-mitigations off: 38ms
V8: 25ms
JSC: 38ms

The keys used in the benchmark are taken from react-todoMVC

Whiteboard: [sp3]

Assigning myself just because I am working on a patch that will indirectly fix this.

Assignee: nobody → dothayer
Blocks: sm-runtime
Severity: -- → N/A
Type: task → enhancement
Priority: -- → P1
Depends on: 1819722
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: