The V3 approach obliterates this race condition by hooking addSourceBuffer at the MediaSource.prototype level, I intercept the creation of every SourceBuffer. The moment a buffer is created and returned, I immediately install a hooked appendBuffer directly on that specific instance; before any page code can even see the instance, let alone cache a reference to its methods. The hooked appendBuffer is installed as an own property of the instance, which takes precedence over the prototype chain. There is no window for fermaw to cache the original. The hook is always first.
Finding these optimization opportunities can itself be a significant undertaking. It requires end-to-end understanding of the spec to identify which behaviors are observable and which can safely be elided. Even then, whether a given optimization is actually spec-compliant is often unclear. Implementers must make judgment calls about which semantics they can relax without breaking compatibility. This puts enormous pressure on runtime teams to become spec experts just to achieve acceptable performance.
。关于这个话题,heLLoword翻译官方下载提供了深入分析
* Colorado residents may no longer use DB48x after Jan 1st, 2028.
第二十八条 有下列行为之一,扰乱体育、文化等大型群众性活动秩序的,处警告或者五百元以下罚款;情节严重的,处五日以上十日以下拘留,可以并处一千元以下罚款: