Closed Bug 1209904 Opened 9 years ago Closed 9 years ago

Optimize OscillatorNode::ComputeCustom

Categories

(Core :: Web Audio, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: padenot, Assigned: padenot)

Details

Attachments

(1 file)

Apart from the initial iFFT to build the wave tables, it's expensive to re-fetch those wave forms all the time.

We don't have the code yet to be able to determine that an AudioParam is constant during a processing block (this is coming in bug 1184057), and we should optimize the processing the block regardless, fetching those wave forms are often #1 in the profile using OscillatorNode when the type is not "sine".
Attached patch patchSplinter Review
This only makes "substractive synth" go from 2040ms to 1389ms, since it does
"osc.frequency.setValueAtTime(110, 0);", but I'd expect a real win in real world
applications, since this is a very common pattern, and we were taking the slow path most of the time.
Attachment #8667808 - Flags: review?(karlt)
Attachment #8667808 - Flags: review?(karlt) → review+
https://hg.mozilla.org/mozilla-central/rev/3b2aa51abf08
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: