measure how DOM bindings are used in practice

RESOLVED WORKSFORME

Status

()

RESOLVED WORKSFORME
8 years ago
3 years ago

People

(Reporter: gal, Assigned: gal)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

8 years ago
We are trying to optimize the following things:

- extracting the C++ object from the JS object
- indexed property access
- magic named property access
- lookup

For this we want to get a sample of all property accesses on Dromaeo, facebook, cnn etc and for each access we need:
- code location
- what object the access happened on (identity, class)
- property name
- what object along the proto the property was found on
(Assignee)

Comment 1

8 years ago
Created attachment 518855 [details] [diff] [review]
measurement patch
Assignee: nobody → gal
(Assignee)

Comment 2

8 years ago
The patch requires all JITs to be off.
(Assignee)

Comment 3

8 years ago
Nice. The attached patch makes apple gcc consume 8GB of memory as it iloops. Thanks apple.
(Assignee)

Comment 4

8 years ago
Created attachment 518889 [details] [diff] [review]
patch

working patch
Attachment #518855 - Attachment is obsolete: true
(Assignee)

Comment 5

8 years ago
INDEX is the set of all indexed property names 0..N

Facebook:

Property accesses:
  24444 GETPROP
   9273 GETELEM
   1316 SETPROP
    268 SETELEM

Top 20 property names:
   9465 className
   9051 INDEX
   2141 parentNode
   1669 __FB_TOKEN
   1218 nodeName
    993 getAttribute
    873 length
    783 body
    605 type
    520 offsetHeight
    410 defaultView
    410 currentStyle
    408 target
    402 firstChild
    354 Priority
    323 id
    311 nodeType
    310 documentElement
    260 _inherits_from_prototype
    242 returnValue

gmail:

Property accesses:
  40912 GETPROP
  13661 GETELEM
   4388 SETPROP
    476 SETELEM

Top 20 property names:
  11757 className
  11020 INDEX
   2756 closure_uid_INDEXyjl1o
   1507 ctrlKey
   1380 Bfa
   1270 clientY
   1270 clientX
   1149 type
   1020 style
    795 id
    771 addEventListener
    770 keyCode
    763 readyState
    762 metaKey
    762 altKey
    760 target
    759 button
    756 parentNode
    746 shiftKey
    745 state

Dromaeo DOM core benchmarks:

Property accesses:
3563286 GETPROP
1219713 GETELEM
 307687 SETPROP
 287638 SETELEM

Top 20 property names:
1026835 length
 910017 INDEX
 644181 nodeType
 614672 id
 593920 testINDEX
 485454 nextSibling
 484800 previousSibling
 244316 firstChild
 201200 lastChild
 163682 body
   2314 nodeName
   2176 jQueryINDEX
    749 childNodes
    635 parentNode
    468 innerHTML
    379 constructor
    347 createElement
    338 ownerDocument
    266 width
    264 tagName
(Assignee)

Comment 6

8 years ago
The first thing that sticks out to me is that dromaeo doesn't represent at all what gmail and facebook do. Both use className heavily. I have a nice data set and I can analyze it pretty easily now. I will post some more analysis tonight.
I think bz has done plenty of profiling of DOM bindings in the last few years.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.