Bug 238736 - Simplify / Optimize the whitespace cache implementation
Summary: Simplify / Optimize the whitespace cache implementation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-04 07:18 PDT by Chris Dumez
Modified: 2022-04-08 15:07 PDT (History)
9 users (show)

See Also:


Attachments
Patch (5.34 KB, patch)
2022-04-04 07:23 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (5.32 KB, patch)
2022-04-04 10:10 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Follow-up to fix style (1.24 KB, patch)
2022-04-08 14:51 PDT, Chris Dumez
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2022-04-04 07:18:12 PDT
Simplify / Optimize the whitespace cache implementation.
Comment 1 Chris Dumez 2022-04-04 07:23:35 PDT
Created attachment 456568 [details]
Patch
Comment 2 Sam Weinig 2022-04-04 09:43:13 PDT
Comment on attachment 456568 [details]
Patch

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

> Source/WebCore/html/parser/HTMLConstructionSite.h:245
> +    WhitespaceCache() :
> +        m_atoms(maximumCachedStringLength)
> +    { }

Unconventional style. Probably this:

WhitespaceCache()
    : m_atoms(maximumCachedStringLength)
{
}
Comment 3 Chris Dumez 2022-04-04 09:49:45 PDT
(In reply to Sam Weinig from comment #2)
> Comment on attachment 456568 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=456568&action=review
> 
> > Source/WebCore/html/parser/HTMLConstructionSite.h:245
> > +    WhitespaceCache() :
> > +        m_atoms(maximumCachedStringLength)
> > +    { }
> 
> Unconventional style. Probably this:
> 
> WhitespaceCache()
>     : m_atoms(maximumCachedStringLength)
> {
> }

Ooops, my bad, not sure what happened there.
Comment 4 Chris Dumez 2022-04-04 10:10:17 PDT
Created attachment 456584 [details]
Patch
Comment 5 EWS 2022-04-04 12:26:21 PDT
Committed r292310 (249203@main): <https://commits.webkit.org/249203@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 456584 [details].
Comment 6 Radar WebKit Bug Importer 2022-04-04 12:27:18 PDT
<rdar://problem/91255370>
Comment 7 Darin Adler 2022-04-08 14:47:45 PDT
Comment on attachment 456584 [details]
Patch

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

> Source/WebCore/html/parser/HTMLConstructionSite.h:52
> +namespace WebCore {
>  struct HTMLConstructionSiteTask {

Missing space here.
Comment 8 Chris Dumez 2022-04-08 14:48:46 PDT
Comment on attachment 456584 [details]
Patch

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

>> Source/WebCore/html/parser/HTMLConstructionSite.h:52
>>  struct HTMLConstructionSiteTask {
> 
> Missing space here.

I can add a blank line between the namespace and the struct, assuming that's what you mean.
Comment 9 Chris Dumez 2022-04-08 14:51:33 PDT
Reopening to attach new patch.
Comment 10 Chris Dumez 2022-04-08 14:51:54 PDT
Created attachment 457121 [details]
Follow-up to fix style
Comment 11 Darin Adler 2022-04-08 15:02:29 PDT
Comment on attachment 457121 [details]
Follow-up to fix style

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

> Source/WebCore/html/parser/HTMLConstructionSite.h:52
>  namespace WTF {
> +
>  template<> struct VectorTraits<WebCore::AtomStringWithCode> : SimpleClassVectorTraits { };
> +
>  }

Not sure we needed these, but the others do seem important to look right.
Comment 12 Chris Dumez 2022-04-08 15:07:49 PDT
Committed r292638 (249458@trunk): <https://commits.webkit.org/249458@trunk>