Closed
Bug 1749901
Opened 3 years ago
Closed 3 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)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
INVALID
People
(Reporter: mayankleoboy1, Unassigned)
References
(Blocks 1 open bug, )
Details
go to https://codepen.io/DonKarlssonSan/pen/poWgzgy
click on the page to redraw the shapes
Comment 1•3 years ago
|
||
A lot of time (> 20%) in fdlibm::hypot(double, double)
.
Comment 2•3 years ago
|
||
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: 3 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 3•3 years ago
|
||
thanks for the analysis!
Updated•2 years ago
|
Blocks: sm-codepen-slower
You need to log in
before you can comment on or make changes to this bug.
Description
•