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

Improve performance (maybe) #2

Merged
merged 1 commit into from
Aug 24, 2020
Merged

Improve performance (maybe) #2

merged 1 commit into from
Aug 24, 2020

Conversation

ziir
Copy link
Member

@ziir ziir commented Aug 23, 2020

  • Add basic ./benchmark folder
  • Add third optional options: { concurrency } argument:
    • getFileAudioBuffer(file, audioCtx, options = {})
    • concurrency option must be a number, a falsy value will result in the "auto" mode being used.

- scale the number of audio-decoding workers from 4 previously to the number
  of logical cores presumably available as reported by the
  browser via navigator.hardwareConcurrency.
  See https://twitter.com/tpillard/status/1297562478822543360
- do not spawn more audio-decoding workers than number of chunks to
  decode.
- when reconstructing the final AudioBuffer, use
  AudioBuffer.prototype.copyToChannel() instead of combination of
  AudioBuffer.prototype.getChannelData() + TypedArray.prototype.set()

+ Add basic ./benchmark folder
+ Add third optional `options: { concurrency }` argument:
  - `getFileAudioBuffer(file, audioCtx, options = {})`
  - `concurrency` option must be a number, a falsy value will result in
    the "auto" mode being used.
@ziir ziir force-pushed the maybe-improve-performance branch from 8e7088c to 21da806 Compare August 24, 2020 22:25
@ziir ziir merged commit cb8f22e into master Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant