Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a6d91e7d8f97f21ba3878cb1e722ae2bc75180cc
      
https://github.com/WebKit/WebKit/commit/a6d91e7d8f97f21ba3878cb1e722ae2bc75180cc
  Author: Jer Noble <[email protected]>
  Date:   2024-04-08 (Mon, 08 Apr 2024)

  Changed paths:
    A PerformanceTests/AudioContext/audio-context-creation.html
    M Source/WebCore/platform/audio/SharedAudioDestination.cpp

  Log Message:
  -----------
  REGRESSION(275262@main) AudioContext.start() takes longer than it used to.
https://bugs.webkit.org/show_bug.cgi?id=272240
rdar://124071843

Reviewed by Eric Carlson.

In 275262@main, SharedAudioDestination was added to reduce the runtime overhead 
of having
multiple AudioDestinations with the same configuration running simultaneously. 
The
SharedAudioDestination passes its start() and stop() completion handlers to
SharedAudioDestinationAdapter, which calls the completion handler when the 
underlying
AudioDestination starts and stops. But if the destination is already running, 
it waits
until that destination is fully "configured" to call the completion handler, 
and this
configuration happens on the audio render thread. The audio render thread spins 
every 3ms,
so this delay should average out to 1.5ms. However, the underlying 
RemoteAudioDestinationProxy
will run its completion handler without waitaing for the audio device to start, 
so the delay
for that class is much smaller: effecitvely the duration of the XPC call.

In the case that the AudioDestination starts and stops, continue to pass the 
completion
handler to that method. But in the case where the AudioDestination is already 
running and
the list of renderers just needs to be updated, assume that will succeed and 
just run the
completion handler in the next run loop.

* PerformanceTests/AudioContext/audio-context-creation.html: Added.
* Source/WebCore/platform/audio/SharedAudioDestination.cpp:
(WebCore::SharedAudioDestinationAdapter::~SharedAudioDestinationAdapter):
(WebCore::SharedAudioDestinationAdapter::configureRenderThread):
(WebCore::SharedAudioDestinationAdapter::render):
(WebCore::SharedAudioDestinationAdapter::callAllConfigurationHandlers): Deleted.

Canonical link: https://commits.webkit.org/277209@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to