[webkit-reviews] review granted: [Bug 222533] Reduce promise reaction memory usage when there are multiple reactions : [Attachment 421839] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 1 16:15:00 PST 2021


Yusuke Suzuki <ysuzuki at apple.com> has granted Keith Miller
<keith_miller at apple.com>'s request for review:
Bug 222533: Reduce promise reaction memory usage when there are multiple
reactions
https://bugs.webkit.org/show_bug.cgi?id=222533

Attachment 421839: Patch

https://bugs.webkit.org/attachment.cgi?id=421839&action=review




--- Comment #3 from Yusuke Suzuki <ysuzuki at apple.com> ---
Comment on attachment 421839
  --> https://bugs.webkit.org/attachment.cgi?id=421839
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=421839&action=review

r=me with comment.

> Source/JavaScriptCore/ChangeLog:14
> +	   Previously, we would store each reaction in a linked list. This
> +	   meant each reaction required 8 bytes to point to the next
> +	   reaction.  Instead, this patch makes it so the first reaction is
> +	   store inline an object and any additional reactions are store into
> +	   index storage for that object. This doesn't save memory for the
> +	   first reaction since we now need to have a count of all the out of
> +	   line reactions but extra reactions use 8 bytes less each.

Does it show RAMification improvement?

> Source/JavaScriptCore/builtins/PromiseOperations.js:153
> +    var isResolved = state == @promiseStateFulfilled;

Use `===` instead of `==`.


More information about the webkit-reviews mailing list