New issue
Advanced search Search tips

Issue 756238 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Performance regression in WebAudio OfflineAudioContext rendering

Project Member Reported by rtoy@chromium.org, Aug 16 2017

Issue description

Chrome Version: 61 or later

What steps will reproduce the problem?
(1) Visit rtoy.github.io/webaudio-benchmarks
(2) Look at the results.
(3)

What is the expected result?

The time of each test should be roughly the same as the results from Chrome 60.

What happens instead?

For many of the tests, the times are double (or more) compared to M60.

A bisect points to this CL as the culprit: https://chromium.googlesource.com/chromium/src/+log/5228807000338fafae554d7a57741a647c916acf..b4cd8f350b4ff9d2c8670b36d5ff77badd6409e2

Very likely: https://codereview.chromium.org/2913303002

This CL causes HandleStoppableSourceNodes to post a task to the main thread.  HandleStoppableSourceNodes gets called every render quantum (3ms) if there are any active source nodes.  For the tests, there is always at least one active source node.

 

Comment 1 by rtoy@chromium.org, Aug 18 2017

Summary: Performance regression in WebAudio OfflineAudioContext rendering (was: Performance regression in WebAudio)

Comment 2 by rtoy@chromium.org, Aug 24 2017

Correction:  since the test is using an offline context we post tasks to the main thread as fast as we can, basically as soon as the graph has rendered some data.

Comment 3 by rtoy@chromium.org, Feb 15 2018

The test url is https://rtoy.github.io/webaudio-benchmark/

Comment 4 by rtoy@chromium.org, Feb 15 2018

The fix from issue 804946 has improved results.

Results for chrome 65.0.3325.7 running on my linux box:


Test name	Time in ms	Speedup vs. realtime	Sound
Empty testcase	59	2033.9x	Play (120s)
Simple gain test without resampling	225	533.3x	Play (120s)
Simple gain test without resampling (Stereo)	246	487.8x	Play (120s)
Simple gain test without resampling (Stereo and positional)	360	333.3x	Play (120s)
Simple gain test	206	582.5x	Play (120s)
Simple gain test (Stereo)	241	497.9x	Play (120s)
Simple gain test (Stereo and positional)	376	319.1x	Play (120s)
Upmix without resampling (Mono -> Stereo)	281	427x	Play (120s)
Downmix without resampling (Mono -> Stereo)	204	588.2x	Play (120s)
Simple mixing (same buffer)	1681	17.8x	Play (30s)
Simple mixing (different buffers)	1652	18.2x	Play (30s)
Simple mixing with gains	1413	212.3x	Play (300s)
Convolution reverb	1605	18.7x	Play (30s)
Granular synthesis	45746	0.7x	Play (30s)
Synth	303	99x	Play (30s)
Substractive synth	187	160.4x	Play (30s)
Stereo Panning	472	254.2x	Play (120s)
Stereo Panning with Automation	470	255.3x	Play (120s)
Periodic Wave with Automation	288	416.7x	Play (120s)

From ToT today (chromium 66.0.3349.0, same machine):
Empty testcase	65	1846.2x	Play (120s)
Simple gain test without resampling	136	882.4x	Play (120s)
Simple gain test without resampling (Stereo)	149	805.4x	Play (120s)
Simple gain test without resampling (Stereo and positional)	197	609.1x	Play (120s)
Simple gain test	134	895.5x	Play (120s)
Simple gain test (Stereo)	143	839.2x	Play (120s)
Simple gain test (Stereo and positional)	201	597x	Play (120s)
Upmix without resampling (Mono -> Stereo)	158	759.5x	Play (120s)
Downmix without resampling (Mono -> Stereo)	130	923.1x	Play (120s)
Simple mixing (same buffer)	1223	24.5x	Play (30s)
Simple mixing (different buffers)	1298	23.1x	Play (30s)
Simple mixing with gains	826	363.2x	Play (300s)
Convolution reverb	1206	24.9x	Play (30s)
Granular synthesis	28413	1.1x	Play (30s)
Synth	164	182.9x	Play (30s)
Substractive synth	174	172.4x	Play (30s)
Stereo Panning	159	754.7x	Play (120s)
Stereo Panning with Automation	187	641.7x	Play (120s)
Periodic Wave with Automation	198	606.1x	Play (120s)

All are significantly better (except the empty test case), some by a factor of 3 or more. The granular synthesis is now also faster than realtime (unlike before).

But many tests are still significantly worse than Firefox nightly.  I have a vague memory that this wasn't the case long ago.  We were generally faster or at least no slower than Firefox (of the same vintage).

Sign in to add a comment