Add a way to determine if an AudioParam is constant for a block
Categories
(Core :: Web Audio, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox119 | --- | fixed |
People
(Reporter: padenot, Assigned: karlt)
References
(Blocks 3 open bugs)
Details
(Keywords: perf, perf-alert)
Attachments
(7 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 |
This is a nice optimization, since sometimes, having the param value that changes induces costly recomputations. This is especially necessary since `AudioParam.value` now adds a timeline event.
Updated•9 years ago
|
Comment hidden (obsolete) |
Updated•2 years ago
|
Assignee | ||
Comment 2•7 months ago
|
||
An approximation of this is to have a simple value recorded on the AudioEventTimeline when there are no further events in the future and the last event in the past is not a SetTarget.
This would address the common case of events having already passed, and would be sufficient to address the case of making the value
setter behave like setValueAtTime()
.
It is an easy case to detect because once the event is known simple, no further analysis of events is required (until another event is added).
Assignee | ||
Comment 3•7 months ago
|
||
This approach of comment 2 provides benchmark time reductions of 64 - 73% on Stereo Panning with Automation, 24 - 30% on Granular synthesis, 13 - 29% on Periodic Wave with Automation, and 6 - 20 % on Substractive synth.
A regression of 18% was reported on the "Stereo Panning" benchmark only on 32-bit WINNT. However, running the same comparison without the larger benchmarks, "Granular synthesis", "Synth", and "Substractive synth", does not show the same regression, implying that the apparent regression was a bleeding of one benchmark's work into another, perhaps a result of GC after the more complex graphs. The last benchmarks run in this order: "Granular synthesis", "Synth", "Substractive synth", "Stereo Panning", "Stereo Panning with Automation", "Periodic Wave with Automation".
Assignee | ||
Comment 4•7 months ago
|
||
Updated•7 months ago
|
Assignee | ||
Comment 5•7 months ago
|
||
mSetValue might be a more accurate name right now, but this will be the
default value when bug 1308435 is fixed. Its purpose will be to record the
value to return when there are no events, including when events have been
removed.
Depends on D188938
Assignee | ||
Comment 6•7 months ago
|
||
Depends on D188939
Assignee | ||
Comment 7•7 months ago
|
||
Depends on D188940
Assignee | ||
Comment 8•7 months ago
|
||
This retains some double precision from mDuration instead of truncating
mDuration.
Event start times are already rounded to ticks, so perhaps the end time could
be also, but that would require some care with end time out of range of
int64_t. These uses always have a subsequent event and so the end time would
not be out of range.
Changes in rendering are expected to be minor.
Depends on D188941
Assignee | ||
Comment 9•7 months ago
|
||
so that they can be used outside of GetValuesAtTimeHelperInternal() in a
subsequent patch.
Depends on D188942
Assignee | ||
Comment 10•7 months ago
|
||
Depends on D188943
Comment 11•7 months ago
|
||
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f22fd10b14cc rename AudioEventTimeline::mValue to mDefaultValue r=padenot https://hg.mozilla.org/integration/autoland/rev/c23bf75d074e unify handling of no next event and ignored next event r=padenot
Comment 12•7 months ago
|
||
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d57a6e27f79e clarify distinction between start and end time of event r=padenot https://hg.mozilla.org/integration/autoland/rev/5ce53217bf3e use double type for end time of event r=padenot
Comment 13•7 months ago
|
||
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4d85ecdd90eb move end time and value functions to AudioTimelineEvent r=padenot
Comment 14•7 months ago
|
||
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e4787339734b use simple AudioEventTimeline value when it has a suitable single event r=padenot
Comment 15•7 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/f22fd10b14cc
https://hg.mozilla.org/mozilla-central/rev/c23bf75d074e
https://hg.mozilla.org/mozilla-central/rev/d57a6e27f79e
https://hg.mozilla.org/mozilla-central/rev/5ce53217bf3e
Comment 16•7 months ago
|
||
bugherder |
Updated•7 months ago
|
Comment 17•7 months ago
|
||
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7056fe8e144d remove unused CancelAllEvents() r=padenot
Comment 18•7 months ago
|
||
bugherder |
Comment 19•7 months ago
|
||
(In reply to Pulsebot from comment #14)
Pushed by ktomlinson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e4787339734b
use simple AudioEventTimeline value when it has a suitable single event
r=padenot
== Change summary for alert #39690 (as of Thu, 28 Sep 2023 09:21:09 GMT) ==
Improvements:
Ratio | Test | Platform | Options | Absolute values (old vs new) | Performance Profiles |
---|---|---|---|---|---|
8% | webaudio | macosx1015-64-shippable-qr | fission webrender | 98.25 -> 89.92 | Before/After |
8% | webaudio | linux1804-64-shippable-qr | fission webrender | 116.50 -> 106.83 | Before/After |
8% | webaudio | linux1804-64-shippable-qr | fission webrender | 117.17 -> 107.75 | Before/After |
7% | webaudio | windows10-64-shippable-qr | fission webrender | 91.83 -> 85.25 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=39690
Updated•7 months ago
|
Description
•