Open Bug 1880795 Opened 11 months ago Updated 2 months ago

JS demo (https://www.fxhash.xyz/generative/19851) is 50% slower in Nightly

Categories

(Core :: JavaScript Engine, task, P5)

task

Tracking

()

People

(Reporter: mayankleoboy1, Unassigned)

References

(Blocks 1 open bug, )

Details

Some other demos by the same author are also worse in Nightly
https://www.fxhash.xyz/generative/20874 : https://share.firefox.dev/3SH6pAB

The demo uses p5.js, which includes a so-called Friendly Error System. This feature validates each function call parameter by performing object lookups and therefore should only be used during development, because it's known to lead to degraded performance.

In this specific case, the function arguments are fractional numbers, so we end up repeatedly calling js::NumberToAtom, which in turns calls FracNumberToCString and js::Atomize. We have a one-element double-to-string cache, whereas V8's double-to-string cache initially has 256 elements, but can grow up to 16384 elements. So V8 is only faster because they have a larger cache, which means less time is spent for double-to-string conversions.

Priority: -- → P3
Priority: P3 → P5
See Also: → 1935596
You need to log in before you can comment on or make changes to this bug.