Inline Map/Set operations

NEW
Unassigned

Status

()

Core
JavaScript Engine: JIT
P3
normal
a year ago
10 months ago

People

(Reporter: evilpie, Unassigned)

Tracking

(Blocks: 3 bugs, {perf})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

a year ago
Developers should be able to use Map/Set instead of normal JS objects, but still get predictable performance. We should inline the lookup and hash calculate for Map#get, Map#has and Set#has. Optimizing Map#set and Set#add wouldn't hurt.
Blocks: 1307062
Priority: -- → P3
Keywords: perf
(Reporter)

Comment 1

10 months ago
Created attachment 8905667 [details] [diff] [review]
Call Map::has and Set::has directly

I was curious how much it would help to optimize those functions to a direct call. Even on six-speed's map-set-lookup this doesn't really seem to make a difference at all.

I guess we could use the AliasSet to hoist this, but that is just cheating, we aren't actually faster. 

We probably have to write custom inlining code for this. Best case even with compile time hashing for constants, even though this probably doesn't help much in the real world.
You need to log in before you can comment on or make changes to this bug.