Bug 1642016 [wpt PR 23864] - Vectorize DelayNode processor for k-rate delays, a=testonly
authorRaymond Toy <rtoy@chromium.org>
Mon, 22 Jun 2020 10:41:28 +0000
changeset 536832 fcb96ec497a6f4d5fd284bea46b80d4ebf7735b1
parent 536831 04af5449d09e655bcd0cda458c4e851411b280bc
child 536833 5e1ec38dd7a121a93b8831c899102e13d69fd377
push id119680
push userwptsync@mozilla.com
push dateTue, 23 Jun 2020 11:08:22 +0000
treeherderautoland@7ca3d4bada73 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1642016, 23864, 1087071, 2171843, 779062
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1642016 [wpt PR 23864] - Vectorize DelayNode processor for k-rate delays, a=testonly Automatic update from web-platform-tests Vectorize DelayNode processor for k-rate delays Instead of processing the data one sample at a time, we can process a block at a time by doing large memcpy's and then some vector operations to interpolate the samples. As a final micro-optimization, if the interpolation factor is 0, we can skip the interpolation phase altogether. Using (a slightly modified) Spotify's Web Audio Bench, we have the following results using 500 runs of 10 sec each (the default) on a linux machine: Without CL: TEST μs MIN Q1 MEDIAN Q3 MAX MEAN STDDEV Baseline 594 594 740 751 761 3215 757.82 146.55 Delay-default 331 331 387 405 416 2124 406.47 81.65 Delay-0.1 344 344 401 423 440 834 425.68 41.04 DelayAutomation-a-rate 675 675 748 763 779 1262 768.23 42.97 DelayAutomation-k-rate 365 365 424 444 460 1036 446.24 38.61 With CL: TEST μs MIN Q1 MEDIAN Q3 MAX MEAN STDDEV Baseline 736 736 747 756 765 901 758.57 17.76 Delay-default 180 180 230 249 267 1467 256.75 77.1 Delay-0.1 233 233 302 317 332 2402 322.39 96.86 DelayAutomation-a-rate 612 612 683 698 713 983 701.78 33.85 DelayAutomation-k-rate 206 206 281 299 318 522 305.34 37.96 As we can see, the CL speeds up processing the default by 38%, delay-0.1 25% and k-rate by 32% (using the mean and not us results). One layout test needed to be updated to handle numerical differences for mac. The implementation of Vsma on mac is different from linux and windows. and this difference shows up in the test. (Mac uses VDSP_vsma, instead of our hand-written Vsma. VDSP_vsma might be using an FMA which has different round properties.) Bug: 1087071 Change-Id: I2b95096fef9fd1e5f7c87e4f4bdfa7d52f5b8d58 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2171843 Commit-Queue: Raymond Toy <rtoy@chromium.org> Reviewed-by: Hongchan Choi <hongchan@chromium.org> Cr-Commit-Position: refs/heads/master@{#779062} -- wpt-commits: c4fef962c5d98c16f212f768896188824500d41b wpt-pr: 23864
testing/web-platform/tests/webaudio/the-audio-api/the-delaynode-interface/no-dezippering.html
--- a/testing/web-platform/tests/webaudio/the-audio-api/the-delaynode-interface/no-dezippering.html
+++ b/testing/web-platform/tests/webaudio/the-audio-api/the-delaynode-interface/no-dezippering.html
@@ -88,17 +88,18 @@
                       .beEqualToArray(ramp1);
                 })
                 .then(() => task.done());
           });
 
       audit.define(
           {label: 'test1', description: 'Test value setter and setValueAtTime'},
           (task, should) => {
-            testWithAutomation(should, {prefix: ''}).then(() => task.done());
+            testWithAutomation(should, {prefix: '', threshold: 5.9605e-8})
+                .then(() => task.done());
           });
 
       audit.define(
           {label: 'test2', description: 'Test value setter and modulation'},
           (task, should) => {
             testWithAutomation(should, {
               prefix: 'With modulation: ',
               modulator: true
@@ -163,21 +164,21 @@
 
         src.start();
 
         return context.startRendering().then(renderedBuffer => {
           let actual = renderedBuffer.getChannelData(0);
           let expected = renderedBuffer.getChannelData(1);
 
           let match = should(actual, prefix + '.value setter output')
-                          .beEqualToArray(expected);
+                          .beCloseToArray(
+                              expected, {absoluteThreshold: options.threshold});
           should(
               match,
               prefix + '.value setter output matches setValueAtTime output')
               .beTrue();
         });
       }
 
       audit.run();
-
     </script>
   </body>
 </html>