Closed Bug 1749901 Opened 2 years ago Closed 2 years ago

Demo at https://codepen.io/DonKarlssonSan/pen/poWgzgy is slow. All the time is spent in JS

Categories

(Core :: JavaScript Engine: JIT, enhancement)

enhancement

Tracking

()

RESOLVED INVALID

People

(Reporter: mayankleoboy1, Unassigned)

References

(Blocks 1 open bug, )

Details

See Also: → 1732605

A lot of time (> 20%) in fdlibm::hypot(double, double).

This page sounds as slow as in chromium and the code has not been optimized for the task it is trying to accomplish either.

Multiple optimizations are possible, such as:

  • Compute the distance once for each point.
  • Use a different sort algorithm such as a Radix sort.
  • Pre-segment the space with a quad tree.

JavaScript language is difficult to optimize automatically given all the corner cases of the languages.
These optimizations are easier done in JavaScript, with someone who know the domain and the application than done by a JIT compiler which will attempt to guess applicable local transformations.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID

thanks for the analysis!

You need to log in before you can comment on or make changes to this bug.