Bug 79299

Summary: Type tags in NodeFlags could be compressed
Product: WebKit Reporter: Hajime Morrita <morrita>
Component: DOMAssignee: Hajime Morrita <morrita>
Status: RESOLVED LATER    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, kling, koivisto, rniwa, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 84511    
Bug Blocks: 77860    
Attachments:
Description Flags
Patch none

Description Hajime Morrita 2012-02-22 16:30:38 PST
We have type tags like:

        IsTextFlag = 1,
        IsCommentFlag = 1 << 1,
        IsContainerFlag = 1 << 2,
        IsElementFlag = 1 << 3,
        IsStyledElementFlag = 1 << 4,
        IsHTMLFlag = 1 << 5,
        IsSVGFlag = 1 << 6,
        InDocumentFlag = 1 << 9,
        IsShadowRootOrSVGShadowRootFlag = 1 << 16,

And these are apparently redundant. We could compress these.
Comment 1 Antti Koivisto 2012-02-22 16:35:51 PST
(In reply to comment #0)
>         InDocumentFlag = 1 << 9,

This one is not redundant.
Comment 2 Hajime Morrita 2012-04-16 00:09:25 PDT
Created attachment 137289 [details]
Patch
Comment 3 Hajime Morrita 2012-04-16 18:17:31 PDT
As Ryosuke's request at #webkit, I took two bencharks from Dromaeo which hit DOM heavily:

dom-modify:     before            after
avg                3,816.93     3,819.05
stdev                  44.37          90.98

dom-traverse:      before            after
avg                  2,472.91     2,520.09
stdev                    62.35          48.05

The lager number is better.
This even shows a tiny improvement. But it's unlikely. It will be just a noise.
I think we can say that this has no observable performance impact.
Comment 4 WebKit Review Bot 2012-04-16 19:15:35 PDT
Comment on attachment 137289 [details]
Patch

Clearing flags on attachment: 137289

Committed r114333: <http://trac.webkit.org/changeset/114333>
Comment 5 WebKit Review Bot 2012-04-16 19:15:40 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Ryosuke Niwa 2012-04-16 19:32:33 PDT
Thanks for the perf. analysis.
Comment 7 Hajime Morrita 2012-04-20 16:46:46 PDT
Reopening due to the report: https://bugs.webkit.org/show_bug.cgi?id=84511
Comment 8 Hajime Morrita 2012-04-20 16:49:31 PDT
See: https://bugs.webkit.org/show_bug.cgi?id=84497
Comment 9 Ahmad Saleem 2022-07-26 10:06:45 PDT
Code seems to be changed a lot in Node.h - https://github.com/WebKit/WebKit/blob/aff87f6cbcf56b5fe448770a00f51814fa626b7c/Source/WebCore/dom/Node.h

I think this patch or patch related changes cannot be applied or already applied in other general concept. Can this be marked as "RESOLVED LATER" and "RESOLVED CONFIGURATION CHANGED"?

-> rniwa@webkit.org - any input since Comment 03 mentioned about having any past discussions with yourself? Thanks!
Comment 10 Ryosuke Niwa 2022-07-26 10:07:46 PDT
We can consider doing this refactoring but keeping this 10 year old bug isn't the way to go. -> Later.