WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
108659
Structure should have a StructureRareData field to save space
https://bugs.webkit.org/show_bug.cgi?id=108659
Summary
Structure should have a StructureRareData field to save space
Mark Hahnenberg
Reported
2013-02-01 10:43:46 PST
Many of the fields in Structure are used in a subset of all total Structures; however, all Structures must pay the memory cost of those fields, regardless of whether they use them or not. Since we can have potentially many Structures on a single page (e.g. bing.com creates ~1500 Structures), it would be profitable to refactor Structure so that not every Structure has to pay the memory costs for these infrequently used fields. To accomplish this, we can create a new StructureRareData class to house these seldom used fields which we can allocate on demand whenever a Structure requires it. This StructureRareData can itself be a JSCell, and can do all the marking of the fields for the Structure. The StructureRareData field will be part of a union with m_previous to minimize overhead. We'll add a new field to JSTypeInfo to indicate that the Structure has a StructureRareData field. During transitions, a Structure will clone its previous Structure's StructureRareData if it has one. There could be some potential for optimizing this process, but the initial implementation will be dumb since we'd be paying these overhead costs for each Structure anyways. Initially we'll only put two fields in the StructureRareData to avoid a memory regression. Over time we'll continue to move fields from Structure to StructureRareData. Optimistically, this could potentially reduce our Structure memory footprint by up to around 75%. It could also clear the way for removing destructors from Structures (and into StructureRareData).
Attachments
Patch
(38.83 KB, patch)
2013-02-01 12:00 PST
,
Mark Hahnenberg
no flags
Details
Formatted Diff
Diff
Patch
(43.49 KB, patch)
2013-02-01 12:34 PST
,
Mark Hahnenberg
no flags
Details
Formatted Diff
Diff
Patch
(42.93 KB, patch)
2013-02-01 14:21 PST
,
Mark Hahnenberg
oliver
: review+
Details
Formatted Diff
Diff
perf results
(19.08 KB, text/plain)
2013-02-01 14:56 PST
,
Mark Hahnenberg
no flags
Details
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Mark Hahnenberg
Comment 1
2013-02-01 12:00:36 PST
Created
attachment 186097
[details]
Patch
Early Warning System Bot
Comment 2
2013-02-01 12:06:38 PST
Comment on
attachment 186097
[details]
Patch
Attachment 186097
[details]
did not pass qt-ews (qt): Output:
http://queues.webkit.org/results/16293947
Mark Hahnenberg
Comment 3
2013-02-01 12:34:57 PST
Created
attachment 186106
[details]
Patch
Early Warning System Bot
Comment 4
2013-02-01 12:46:31 PST
Comment on
attachment 186106
[details]
Patch
Attachment 186106
[details]
did not pass qt-ews (qt): Output:
http://queues.webkit.org/results/16333034
Early Warning System Bot
Comment 5
2013-02-01 13:52:10 PST
Comment on
attachment 186106
[details]
Patch
Attachment 186106
[details]
did not pass qt-wk2-ews (qt): Output:
http://queues.webkit.org/results/16337115
EFL EWS Bot
Comment 6
2013-02-01 14:16:00 PST
Comment on
attachment 186106
[details]
Patch
Attachment 186106
[details]
did not pass efl-ews (efl): Output:
http://queues.webkit.org/results/16341089
Mark Hahnenberg
Comment 7
2013-02-01 14:21:20 PST
Created
attachment 186136
[details]
Patch
Mark Hahnenberg
Comment 8
2013-02-01 14:56:32 PST
Created
attachment 186153
[details]
perf results
Filip Pizlo
Comment 9
2013-02-01 15:03:08 PST
Comment on
attachment 186136
[details]
Patch r=me too
Mark Hahnenberg
Comment 10
2013-02-01 15:14:45 PST
Landed in
http://trac.webkit.org/changeset/141651
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug