[webkit-reviews] review granted: [Bug 227101] [JSC] Optimize JSON.parse with small data by changing Identifier pool mechanism : [Attachment 431622] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 16 18:33:44 PDT 2021


Mark Lam <mark.lam at apple.com> has granted Yusuke Suzuki <ysuzuki at apple.com>'s
request for review:
Bug 227101: [JSC] Optimize JSON.parse with small data by changing Identifier
pool mechanism
https://bugs.webkit.org/show_bug.cgi?id=227101

Attachment 431622: Patch

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




--- Comment #2 from Mark Lam <mark.lam at apple.com> ---
Comment on attachment 431622
  --> https://bugs.webkit.org/attachment.cgi?id=431622
Patch

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

r=me with some suggestions.

> Source/JavaScriptCore/ChangeLog:10
> +	   if JSON.parse is invoked for small data. This patch changes this
pool mechanism so that we do not allocate
> +	   Identifiers until we really need.

I suggest adding a bit more detail:
"This patch changes this pool mechanism so that we do not allocate Identifiers
until we really need." => "This patch changes this pool mechanism so that we do
not waste effort allocating null Identifiers to pre-populate the recent
identifiers pool. Instead, we now use a m_recentIdentifiersIndex uint8_t array
to indicate whether there's a cached recent identifier for each given first
character."

> Source/JavaScriptCore/runtime/LiteralParser.cpp:174
> +    if (indexPlusOne) {

I see.	The reason for using indexPlusOne instead if index is so that 0 can
mean no entry.	I think this is worth a comment.


More information about the webkit-reviews mailing list