Closed Bug 699724 Opened 8 years ago Closed 8 years ago

Shrink js::HashTable

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla11

People

(Reporter: njn, Assigned: njn)

Details

(Whiteboard: [MemShrink:P3])

Attachments

(1 file)

Attached patch patchSplinter Review
HashTable::tableCapacity is redundant with respect to HashTable::hashShift.  The attached patch removes it and replaces occurrences of it with calls to HashTable::capacity(), which computes the capacity from HashTable::hashShift.

This reduces the minimum size of a HashTable object from 24 to 20 bytes on 32-bit platforms, and from 32 to 24 bytes on 64-bit platforms.  Loading Gmail and TechCrunch I see up to 5000 HashTables live at any one time, so it can save up to ~40KB on 64-bit platforms for that workload.  Pretty small, but pretty easy too.  I run Sunspider to check there was no adverse performance effects, changes were neglible.
Attachment #571890 - Flags: review?(luke)
Summary: Shrink HashTable → Shrink js::HashTable
Could you also test Kraken and V8?
Kraken and V8 both also have negligible changes.
Comment on attachment 571890 [details] [diff] [review]
patch

Great!
Attachment #571890 - Flags: review?(luke) → review+
https://hg.mozilla.org/mozilla-central/rev/c279d3c09e45
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
You need to log in before you can comment on or make changes to this bug.