DescriptionThe entity table contained pointers which both makes it big and prevents
it from being reused as-is from the binary. This changes it to make
the storage more compact by replacing pointers with offsets into a
shared string. Also switching to more compact data types.
The new database will look like:
static const LChar staticEntityStringStorage[] = {
'A', 'E', 'l', 'i', 'g',
';',
'A', 'M', 'P',
';',
'A', 'a', 'c', 'u', 't', 'e',
';',
...
static const HTMLEntityTableEntry staticEntityTable[2231] = {
{ 0x000C6, 0, 0, 5 }, // Æ
{ 0x000C6, 0, 0, 6 }, // Æ
{ 0x00026, 0, 6, 3 }, // &
{ 0x00026, 0, 6, 4 }, // &
{ 0x000C1, 0, 10, 6 }, // Á
...
The binary will shrink by about 20-35 KB (depending on architecture),
the memory usage should shrink by similar numbers for every
renderer (since the memory now can be shared between renderers) and
there will be a tiny startup time improvement due to
fewer relocation blocks and less to read from disk.
It accomplishes the savings by avoiding pointers in the data (resolving pointers
during startup is expensive), using one string instead of 2000+, not storing the
trailing NUL byte, ordering the members for minimum padding, using minimal size
data types and reusing the same string space for things like "amp;" and "amp".
BUG=352141
R=
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=169438
Patch Set 1 #
Total comments: 1
Messages
Total messages: 12 (0 generated)
|