web-audio-api-rs icon indicating copy to clipboard operation
web-audio-api-rs copied to clipboard

Maintain `AudioParamEventTimeline` in control thread

Open b-ma opened this issue 3 years ago • 2 comments
trafficstars

rationale

  • no panic! in render thread (see https://github.com/orottier/web-audio-api-rs/pull/62#discussion_r764294272) - requires a v1 milestone flag?
  • performance

solution to explore

  • ArcSwap https://docs.rs/arc-swap/latest/arc_swap/

b-ma avatar Apr 21 '22 14:04 b-ma

For the record, I tested a naive solution with <Arx<Mutex<AudioParamEventTimeline>>> here: https://github.com/b-ma/web-audio-api-rs/commit/4f30721828104dc7bf337f27a5398a6541f70c78 (I know it is controversial :), but you will be happy this didn't change anything on the benchmarks (except for "Baseline (silence)"... a bit disappointing...)

b-ma avatar Jul 18 '22 14:07 b-ma

Another option would be to keep a copy of every AudioParamEventTimeline in the control thread. Insert the event first locally in the control side copy. Reject if it will 'panic', otherwise ship to render thread.

orottier avatar Sep 14 '22 15:09 orottier