Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize AudioBuffer copying #21322

Open
ferjm opened this issue Aug 2, 2018 · 0 comments
Open

Optimize AudioBuffer copying #21322

ferjm opened this issue Aug 2, 2018 · 0 comments

Comments

@ferjm
Copy link
Member

@ferjm ferjm commented Aug 2, 2018

Apply the optimizations suggested by the spec here:

When an acquire the content operation is performed on an AudioBuffer, the entire operation can usually be implemented without copying channel data. In particular, the last step SHOULD be performed lazily at the next getChannelData() call. That means a sequence of consecutive acquire the contents operations with no intervening getChannelData() (e.g. multiple AudioBufferSourceNodes playing the same AudioBuffer) can be implemented with no allocations or copying.
Implementations can perform an additional optimization: if getChannelData() is called on an AudioBuffer, fresh ArrayBuffers have not yet been allocated, but all invokers of previous acquire the content operations on an AudioBuffer have stopped using the AudioBuffer's data, the raw data buffers can be recycled for use with new AudioBuffers, avoiding any reallocation or copying of the channel data.

@ferjm ferjm mentioned this issue Sep 19, 2018
3 of 3 tasks complete
@ferjm ferjm added this to To do in WebAudio Dec 5, 2018
@ferjm ferjm moved this from To do to Backlog in WebAudio Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
WebAudio
  
Backlog
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.