Repository navigation
Commit db6f7fb
committed
perf(runtime): make canary states fast-mode objects
A state was made with Object::New and a null prototype, which V8 makes a
dictionary-mode object. States are now clones of one empty fast-mode object
with a null prototype, so states that get the same names in the same order
share their maps' transitions.
A 3-name state takes 104 bytes instead of 208. On a phone (release,
canary/all, 6 rounds), against the commits before it: a canary's first
write takes about 0.75 of its time, a new-name write 0.85, constructing a
JS-extended instance with 1-5 fields 0.92-0.94, and a full collection with
10,000 live stateful canaries 0.80-0.88. Rewriting a name a state already
has takes about 1.11, and 1.07 across 512 objects.1 parent 76bb3bc commit db6f7fb
2 files changed
Lines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
972 | 972 | | |
973 | 973 | | |
974 | 974 | | |
975 | | - | |
| 975 | + | |
976 | 976 | | |
977 | 977 | | |
978 | 978 | | |
| |||
999 | 999 | | |
1000 | 1000 | | |
1001 | 1001 | | |
1002 | | - | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
1003 | 1017 | | |
1004 | 1018 | | |
1005 | 1019 | | |
| |||
1023 | 1037 | | |
1024 | 1038 | | |
1025 | 1039 | | |
1026 | | - | |
| 1040 | + | |
1027 | 1041 | | |
1028 | 1042 | | |
1029 | 1043 | | |
| |||
1509 | 1523 | | |
1510 | 1524 | | |
1511 | 1525 | | |
| 1526 | + | |
1512 | 1527 | | |
1513 | 1528 | | |
1514 | 1529 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
547 | 550 | | |
548 | 551 | | |
549 | 552 | | |
| |||
0 commit comments