Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 36b46ec7539e07337a21c998bd5435be4339f45c
      
https://github.com/WebKit/WebKit/commit/36b46ec7539e07337a21c998bd5435be4339f45c
  Author: Keith Miller <keith_mil...@apple.com>
  Date:   2025-04-17 (Thu, 17 Apr 2025)

  Changed paths:
    A JSTests/stress/many-substrings-of-rope-shouldnt-use-excessive-memory-2.js
    A JSTests/stress/many-substrings-of-rope-shouldnt-use-excessive-memory.js
    M Source/JavaScriptCore/runtime/JSString.h

  Log Message:
  -----------
  Many substrings of an unresolved rope shouldn't explode memory
https://bugs.webkit.org/show_bug.cgi?id=291450
rdar://148899404

Reviewed by Yusuke Suzuki.

In https://commits.webkit.org/284502@main we added an optimization that would 
try to walk the rope string and look for the smallest rope to resolve.
Unfortunately, this means if you're taking many substrings of a much larger 
rope then we'll end up balloning memory usage. This happens for at
least one site. For their provided test case we went from ~7MB to ~55MB. In 
order to not regress that case we should resolve the outer most string
if we decide we need to do a resolution at all.

* JSTests/stress/many-substrings-of-rope-shouldnt-use-excessive-memory-2.js: 
Added.
(globalThis.string_list.String.prototype.s):
(let.lo.lp):
(test):
* JSTests/stress/many-substrings-of-rope-shouldnt-use-excessive-memory.js: 
Added.
(getLongRopeString):
* Source/JavaScriptCore/runtime/JSString.h:
(JSC::tryJSSubstringImpl):
(JSC::jsSubstring):

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



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

Reply via email to