Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Issue 13730004: Remove static const from AudioBus interleave methods and optimize! (Closed)

Created:
7 years, 8 months ago by DaleCurtis
Modified:
7 years, 8 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Visibility:
Public.

Description

Remove static const from AudioBus interleave methods and optimize! Using the new AudioBusTest::InterleaveBench on my Z600 over 5 runs: Old: ToInterleaved uint8 took 57.95ms. FromInterleaved uint8 took 24.76ms. ToInterleaved int16 took 47.67ms. FromInterleaved int16 took 23.06ms. ToInterleaved int32 took 59.64ms. FromInterleaved int32 took 26.53ms. New: ToInterleaved uint8 took 56.09ms. FromInterleaved uint8 took 21.91ms. ToInterleaved int16 took 32.68ms. FromInterleaved int16 took 22.96ms. ToInterleaved int32 took 42.30ms. FromInterleaved int32 took 33.45ms. Results are faster across the board except for FromInterleaved int32 which lost ~10ms with the removal of the static const versus an inline constant. I'm writing it off to helpful pipelining. Overall the new methods are ~13% faster. Benchmarking 10000 calls of each data type over 480 frames instead of a single block of 120 seconds of audio yields an even more impressive 2.7x speedup on OSX: Old: [ OK ] AudioBusTest.DISABLED_InterleaveBench (3157 ms) New: [ OK ] AudioBusTest.DISABLED_InterleaveBench (1154 ms) Linux saw only a 10% improvement though -- the discrepancy likely has to do with OSX's usage of SSE2 instructions (versus no-SSE for Linux). The new methods are ~15% faster in aggregate on Windows. It's ~ the same on ToInterleaved() except in the int32 case where the new method is ~40% faster. FromInterleaved() is ~ the same except for the uint8 case which is ~70% faster. BUG=224662 TEST=media_unittests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=194467

Patch Set 1 : Linux benchmarks. #

Total comments: 3

Patch Set 2 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -35 lines) Patch
M media/base/audio_bus.cc View 1 5 chunks +35 lines, -35 lines 0 comments Download
M media/base/audio_bus_unittest.cc View 1 2 chunks +57 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
DaleCurtis
7 years, 8 months ago (2013-04-06 00:45:06 UTC) #1
scherkus (not reviewing)
so the bug is talking about removing statics for raciness not performance where's the performance ...
7 years, 8 months ago (2013-04-08 14:48:30 UTC) #2
DaleCurtis
Previously static initialization added a bunch of conditional blocks that required navigation prior to interleave ...
7 years, 8 months ago (2013-04-08 16:53:09 UTC) #3
scherkus (not reviewing)
On 2013/04/08 16:53:09, DaleCurtis wrote: > Previously static initialization added a bunch of conditional blocks ...
7 years, 8 months ago (2013-04-08 16:55:14 UTC) #4
DaleCurtis
Actually, in that case it gets a lot faster! Benchmarking 10000 iterations of each data ...
7 years, 8 months ago (2013-04-08 17:13:39 UTC) #5
scherkus (not reviewing)
On 2013/04/08 17:13:39, DaleCurtis wrote: > Actually, in that case it gets a lot faster! ...
7 years, 8 months ago (2013-04-08 18:37:19 UTC) #6
DaleCurtis
Yes this is release code. I don't think it's strange. I looked at the assembly ...
7 years, 8 months ago (2013-04-08 18:58:02 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dalecurtis@chromium.org/13730004/4001
7 years, 8 months ago (2013-04-08 19:00:28 UTC) #8
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) media_unittests, remoting_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=115017
7 years, 8 months ago (2013-04-08 19:40:27 UTC) #9
DaleCurtis
https://chromiumcodereview.appspot.com/13730004/diff/4001/media/base/audio_bus.cc File media/base/audio_bus.cc (right): https://chromiumcodereview.appspot.com/13730004/diff/4001/media/base/audio_bus.cc#newcode74 media/base/audio_bus.cc:74: sample = static_cast<Fixed>(v * -min) & min; Sadly, this ...
7 years, 8 months ago (2013-04-08 21:00:30 UTC) #10
DaleCurtis
https://codereview.chromium.org/13730004/diff/4001/media/base/audio_bus.cc File media/base/audio_bus.cc (right): https://codereview.chromium.org/13730004/diff/4001/media/base/audio_bus.cc#newcode74 media/base/audio_bus.cc:74: sample = static_cast<Fixed>(v * -min) & min; On 2013/04/08 ...
7 years, 8 months ago (2013-04-09 00:40:34 UTC) #11
scherkus_google.com
lgtm ... but what about the perf #s on our largest platform? On Apr 8, ...
7 years, 8 months ago (2013-04-09 02:30:14 UTC) #12
DaleCurtis
After wrangling with my Windows build and Blink, I finally have builds working again! tl;dr: ...
7 years, 8 months ago (2013-04-15 20:04:47 UTC) #13
scherkus (not reviewing)
On 2013/04/15 20:04:47, DaleCurtis wrote: > After wrangling with my Windows build and Blink, I ...
7 years, 8 months ago (2013-04-16 01:30:55 UTC) #14
DaleCurtis
7 years, 8 months ago (2013-04-16 22:21:58 UTC) #15
Message was sent while issue was closed.
Committed patchset #2 manually as r194467 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698