Optimize the fast path for AudioDelayDspKernel::Process.
* The interpolation factor is constant so it can be lifted out of the loop. * Computation of the read_position only needs to be done once, and read_index1 can just be incremented in the loop * Cache write_index_ into a local * Change some doubles to floats Using spotify.github.io/web-audio-bench, without this CL we have: TEST μs MIN Q1 MEDIAN Q3 MAX Baseline 397 390 397 397 397 407 Delay-default 943 882 935 943 953 980 Delay-0.1 930 913 913 930 957 967 DelayAutomation-a-rate 1007 988 993 1007 1025 1032 DelayAutomation-k-rate 925 912 918 925 962 973 With thie CL: Baseline 393 323 383 393 393 400 Delay-default 213 210 212 213 253 278 Delay-0.1 235 232 233 235 283 343 DelayAutomation-a-rate 1043 1038 1040 1043 1043 1053 DelayAutomation-k-rate 245 238 243 245 285 313 The optimized version takes about 1/4 the time now. Bug: 1012198 Change-Id: I0de8f0980e9006241293dc97682d812af485bba1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1861036Reviewed-by:Hongchan Choi <hongchan@chromium.org> Reviewed-by:
Andrew MacPherson <andrew.macpherson@soundtrap.com> Commit-Queue: Raymond Toy <rtoy@chromium.org> Cr-Commit-Position: refs/heads/master@{#706595}
Showing
Please register or sign in to comment