DescriptionOilpan: Reduce sizeof(Persistent) to 16 byte
This CL reduces sizeof(Persistent) from 32 byte to 16 byte, although the
actual runtime size per Persistent handle stay the same (i.e., 32 byte).
(Before)
class PersistentNode {
TraceCallback m_trace;
PersistentNode* m_prev;
PersistentNode* m_next;
};
class Persistent : public PersistentNode {
T* m_raw;
};
(After)
class Persistent {
T* m_raw;
PersistentNode* m_persistentNode; // Owns the PersistentNode.
};
class PersistentNode {
TraceCallback m_trace;
void* m_self; // A back pointer to the Persistent.
};
Even though this CL doesn't change the actual size per Persistent handle,
this CL makes our situation better in the following points:
- sizeof(Persistent) matters for performance because a Persistent handle is
used as a part-of object in a DOM object. If sizeof(Persistent) decreases,
we can pack more DOM objects in a given address space and thus improve
the cache locality. This is important for ElementRareData, for example.
- In practice, sizeof(Persistent) is important not to trigger the SameSize
compile assert.
- After this CL, m_raw is placed at the head address of the Persistent handle.
This will reduce the overhead of dereferecing the Persistent handle.
BUG=483380
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=198131
Patch Set 1 #Patch Set 2 : #Patch Set 3 : #Patch Set 4 : #
Total comments: 12
Patch Set 5 : #Patch Set 6 : #
Total comments: 3
Patch Set 7 : #Patch Set 8 : #Patch Set 9 : #
Total comments: 1
Patch Set 10 : #
Messages
Total messages: 26 (10 generated)
|