Shrink js::HashTable

RESOLVED FIXED in mozilla11

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

unspecified
mozilla11
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [MemShrink:P3])

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
Created attachment 571890 [details] [diff] [review]
patch

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)
(Assignee)

Updated

6 years ago
Summary: Shrink HashTable → Shrink js::HashTable

Comment 1

6 years ago
Could you also test Kraken and V8?
(Assignee)

Comment 2

6 years ago
Kraken and V8 both also have negligible changes.

Comment 3

6 years ago
Comment on attachment 571890 [details] [diff] [review]
patch

Great!
Attachment #571890 - Flags: review?(luke) → review+
(Assignee)

Comment 4

6 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/c279d3c09e45
https://hg.mozilla.org/mozilla-central/rev/c279d3c09e45
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
You need to log in before you can comment on or make changes to this bug.