Open Bug 1945313 Opened 14 days ago Updated 11 days ago

Testcase convolving two sine waves N times is 1.7x slower (and may be getting slower as N increases)

Categories

(Core :: JavaScript Engine: JIT, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: mayankleoboy1, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached file Audio convolve.HTML

Open attached testcase
Enter 500 or 1000
Click on "Start convolution)

500
Nightly: https://share.firefox.dev/40UV2KI (26s)
Chrome: https://share.firefox.dev/3EumpSR (17s)
1.5x slower

1000
Nightly: https://share.firefox.dev/3EnsmBm (59s)
Chrome: https://share.firefox.dev/4hkVKXe (34s)
1.7x slower

Testcase generated by chatpgpt on my prompt. I doubt this is a realistic testcase, but hopefully i can highlight some hotspots.
As usual, feel free to INVALID/WONTFIX.

ni? :padenot.

Flags: needinfo?(padenot)

Yeah I'd file this under "general spidermonkey optimization bug", there's almost 0% in Web Audio (although this is DSP code, it is done in JavaScript). So we can rename this to be something like: particular math heavy code is slower in SpiderMonkey.

In the grand scheme of things, you wouldn't do a convolution like this anyways, you would do something like: https://en.wikipedia.org/wiki/Convolution#Fast_convolution_algorithms. This is what the ConvolverNode do under the hood (and it it multithreaded and all that).

Component: Web Audio → JavaScript Engine: JIT
Flags: needinfo?(padenot)

Similarly to bug 1944837, we're unlikely to spend much time examining this, but we can throw it in a bucket of testcases to measure future improvements against.

Blocks: 1945651
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: