5 ms·
The JS version is slow in Firefox because of a silly perf cliff, I filed a bug [0]. A quick fix for that improves the JS version from ~400 ms to ~180 ms for me
by jandem 9y ago
The JS version is slow in Firefox because of a silly perf cliff, I filed a bug [0]. A quick fix for that improves the JS version from ~400 ms to ~180 ms for me locally. ~140 ms if I disable the Nightly-only GC poisoning.
edit: the JS code is a bit buggy: it does |if (Math.abs(dblDiscriminant) < 0.01)| in the |intersection| function, but dblDiscriminant is a var set in the next loop! Math.abs(undefined) is something we can easily optimize in the JIT, but really the JS code is broken. Folding this in our JIT [1] improves this to < 130 ms for me.
Please let us know if you run into JS perf problems, these bugs are usually easy to fix.
[0] https://bugzilla.mozilla.org/show_bug.cgi?id=1425687 https://bugzilla.mozilla.org/show_bug.cgi?id=1425687
[1] https://pastebin.com/CzfP5vQj https://pastebin.com/CzfP5vQj
- sniklaus 9y agoThank you for your evaluation! It should have been dblDenominator instead of dblDiscriminant and I fixed it accordingly. However, this change does not seem to significantly affect performance.