The current algorithm for selecting the ScriptProcessor bufferSize value when the caller uses a value of 0 is very, very conservative. It basically takes 4 times the callback size, rounded up to a power of two.
This needs to be platform-specific. On desktop, it's probably good enough to just double the callback size (rounding up to a power of two). This means a value of 256 or 512 on mac, 1024 on linux because the callback size is 128 or 256 on mac and 512 on linux. Windows is 10 ms---about 440 frames. 1024 is probably a good choice.
For android, the variety of HW devices makes this challenging. Currently on Android, the callback size is at least 2048. For some devices like a Nexus 9, this is probably way too big and should be lowered (but that's a different bug). It's probably ok for now to do same as desktop above. But this needs testing which might be hard to do before landing the changes.
Comment 1 by rtoy@chromium.org
, Dec 20 2016Blocking: 650425