Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 313be2bb1cf5639434e48b7147e8e4d65e63cdb2
      
https://github.com/WebKit/WebKit/commit/313be2bb1cf5639434e48b7147e8e4d65e63cdb2
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-03-18 (Wed, 18 Mar 2026)

  Changed paths:
    M Source/JavaScriptCore/runtime/JSStringInlines.h

  Log Message:
  -----------
  [JSC] Introduce better heuristics for rope resolution ordering
https://bugs.webkit.org/show_bug.cgi?id=310170
rdar://172810886

Reviewed by Dan Hecht.

It is common that we encounter a binary string rope and both sides have
ropes. In this case, ordering of resolution matters much for performance:
we can resolve one side in a nested recursion, and we can resolve the other
side in a self-tail-call, which gets converted to a loop. If we successfully
select deeper nesting rope for the tail-call side, we can reduce callstack
heights, making resolution faster.

While we cannot easily determine which side of rope is more deeply nesting,
we can use length of each rope as a heuristics: resolving shorter one first
and resolving longer one in a tail-call form.

* Source/JavaScriptCore/runtime/JSStringInlines.h:
(JSC::JSRopeString::resolveToBuffer):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to