Closed Bug 1851755 Opened 10 months ago Closed 9 months ago

Reduce number of expf() calls for setTargetAtTime()

Categories

(Core :: Web Audio, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: karlt, Assigned: karlt)

References

Details

Attachments

(10 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Bug 1358149 comment 55 indicates that expf() evaluation is having a significant effect on the "Synth" and "Substractive synth" performance benchmarks, which use setTargetAtTime().

Using a linear recurrence relation to skip most of the expf() calls improves performance on "Substractive synth" by 13-23% and on "Synth" by 10-19% .

See Also: → 1851758
Depends on: 1853597

On top of other recent performance improvements, this now reduces time by 25 - 30% on "Substractive synth".

AudioParam uses ValidateEvent() and InsertEvent().

To simplify parameter sets and clarify which parameters may be in use.

Depends on D189463

This is a more natural place to manage the AudioTimelineEvent members.
It will also be a better place for pre-computing a constant exponential for
SetTarget curves in a subsequent patch.

Depends on D189465

where SetValueCurve requires different parameters.

These objects are copied when inserted into and moved within the
AudioEventTimeline array.

Depends on D189467

This changes failure messages from
assert_true: sample 1471 should equal 0.24924172461032867 expected true got false
to
assert_approx_equals: sample 1471 expected 0.24924172461032867 +/- 0.000001342 but got 0.24924308061599731

Depends on D189468

addressing a cppcoreguidelines-pro-type-member-init warning.

Depends on D189468

Pushed by ktomlinson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/648bf0239d99
remove unused AudioEventTime methods r=padenot
https://hg.mozilla.org/integration/autoland/rev/7139b608a37e
use separate constructor for SetValueCurve AudioTimelineEvent r=padenot
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
Pushed by ktomlinson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4f5e812e3ab7
clarify that AudioParam tracks are handled by AudioParamTimeline not AudioEventTimeline r=padenot
Keywords: leave-open
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Pushed by ktomlinson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f1f858a5c8c2
move ConvertAudioTimelineEventToTicks() to AudioTimelineEvent r=padenot
Pushed by ktomlinson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d7b66b8f2e34
add getters to AudioTimelineEvent::Value() to assert that members are not accessed for the wrong event types r=padenot
Pushed by ktomlinson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/19c7e9c983a2
use a union for more AudioTimelineEvent members r=padenot
https://hg.mozilla.org/integration/autoland/rev/b781e655236d
use assert_approx_equals for comparison with tolerance r=padenot
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/42267 for changes under testing/web-platform/tests
Pushed by ktomlinson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/66bd7c78781a
clarify that mCurve and mCurveLength are set in the AudioTimelineEvent constructor r=padenot
https://hg.mozilla.org/integration/autoland/rev/f90a7a1b6c24
suppress cppcoreguidelines-pro-type-member-init warning for AudioEventTimeline copy constructor r=padenot
Pushed by ktomlinson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1fd044c18e14
pre-compute constant exponential for inter-tick ratio in setTargetAtTime() curves r=padenot
Keywords: leave-open
Upstream PR merged by moz-wptsync-bot
See Also: → 1856738
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: