| Summary: | Cache an entire attribute QualifiedName when parsing HTML, not just its local name AtomString | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Cameron McCormack (:heycam) <heycam> | ||||||
| Component: | DOM | Assignee: | Cameron McCormack (:heycam) <heycam> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | cdumez, changseok, darin, esprehn+autocc, ews-watchlist, gyuyoung.kim, kangil.han, webkit-bug-importer, wenson_hsieh | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Cameron McCormack (:heycam)
2022-02-13 13:31:51 PST
Created attachment 451841 [details]
Patch
Comment on attachment 451841 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=451841&action=review > Source/WebCore/html/parser/HTMLNameCache.h:38 > + ALWAYS_INLINE static AtomString makeTagName(const Vector<UChar, inlineCapacity>& string) Can this take a Span<UChar> instead? Should be just as fast, although we’d need to test. > Source/WebCore/html/parser/HTMLNameCache.h:44 > + ALWAYS_INLINE static QualifiedName makeAttributeQualifiedName(const Vector<UChar, inlineCapacity>& string) Ditto. > Source/WebCore/html/parser/HTMLNameCache.h:50 > + ALWAYS_INLINE static AtomString makeAttributeValue(const Vector<UChar, inlineCapacity>& string) Ditto. > Source/WebCore/html/parser/HTMLNameCache.h:67 > + ALWAYS_INLINE static AtomString makeAtomString(const Vector<UChar, inlineCapacity>& string) Ditto. > Source/WebCore/html/parser/HTMLNameCache.h:89 > + ALWAYS_INLINE static QualifiedName makeQualifiedName(const Vector<UChar, inlineCapacity>& string) Ditto. > Source/WebCore/html/parser/HTMLNameCache.h:134 > + using QualifiedNameCache = std::array<RefPtr<QualifiedName::QualifiedNameImpl>, capacity>; Why is this RefPtr<Impl> instead of just QualifiedName? (In reply to Darin Adler from comment #3) > Can this take a Span<UChar> instead? Should be just as fast, although we’d > need to test. Yes, should be able to. Then it could be untemplatized. > > Source/WebCore/html/parser/HTMLNameCache.h:134 > > + using QualifiedNameCache = std::array<RefPtr<QualifiedName::QualifiedNameImpl>, capacity>; > > Why is this RefPtr<Impl> instead of just QualifiedName? std::array<QualifiedName> would require QualifiedName have a default constructor, which it doesn't currently, since it doesn't support its m_impl being null. Created attachment 451849 [details]
Patch
Committed r289991 (247377@main): <https://commits.webkit.org/247377@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 451849 [details]. |