Closed Bug 1370196 Opened 7 years ago Closed 1 year ago

Maybe add bind_bindFunction3 for Speedometer/react?

Categories

(Core :: JavaScript Engine, enhancement, P5)

enhancement

Tracking

()

RESOLVED INVALID

People

(Reporter: anba, Unassigned)

References

(Blocks 1 open bug)

Details

The React version used in Speedometer calls Function.prototype.bind with three bound arguments, which means it currently uses the slower bind_bindFunctionN implementation. Maybe we should add bind_bindFunction3, so we can avoid some extra array allocations when merging the bound and call arguments.
Numbers for a single run of React and React-Redux from InteractiveRunner.html (bound functions have a negligible use in the other frameworks).


Create bound functions:

React
  0-bound args: 759
  1-bound args: 100273
  2-bound args: 0
  3-bound args: 100
  4-bound args: 0
> 4-bound args: 0

React-Redux
  0-bound args: 711
  1-bound args: 265
  2-bound args: 0
  3-bound args: 0
  4-bound args: 0
> 4-bound args: 0


Calls to bound functions:

React
  0-bound args: 5969
  1-bound args: 1170
  2-bound args: 0
  3-bound args: 100
  4-bound args: 0
> 4-bound args: 0

React-Redux
  0-bound args: 44237
  1-bound args: 515
  2-bound args: 0
  3-bound args: 0
  4-bound args: 0
> 4-bound args: 0


So there are only 100 calls to create bound functions with three bound arguments.
Priority: -- → P5
Severity: normal → S3

Is this fixed by bug 1483869 ?

Flags: needinfo?(jdemooij)

(In reply to Mayank Bansal from comment #2)

Is this fixed by bug 1483869 ?

Yep. We can now also store up to 3 bound arguments inline, which nicely handles this case.

Status: NEW → RESOLVED
Closed: 1 year ago
Flags: needinfo?(jdemooij)
Resolution: --- → FIXED
Resolution: FIXED → INVALID
You need to log in before you can comment on or make changes to this bug.