Closed Bug 431735 Opened 16 years ago Closed 16 years ago

Use rb.h instead of tree.h

Categories

(Core :: Memory Allocator, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jasone, Assigned: jasone)

References

Details

(Keywords: memory-footprint)

Attachments

(2 files, 3 obsolete files)

The red-black tree implementation in mozilla/memory/jemalloc/tree.h uses node linkage that includes four fields: parent, left child, right child, and color.  This causes considerable data structure bloat in jemalloc, especially for the unallocated page run trees, since every run must be accessible via two trees.

It is possible to do away with parent pointers and embed the color in the unused least significant bit of one of the child pointers.  For jemalloc this reduces arena chunk headers from 3-->2 and 5-->3 pages for 32- and 64-bit systems, respectively.  It also reduces run header overhead, which allows single-page runs for a larger range of size classes, thus reducing page-level fragmentation.
Blocks: 431739
Keywords: footprint
Component: General → jemalloc
Product: Firefox → Core
QA Contact: general → jemalloc
Attached patch Use rb.h instead of tree.h (obsolete) — Splinter Review
Use rb.h instead of tree.h for red-black trees, in order to reduce memory
overhead.
Attached patch Use rb.h instead of tree.h (v2) (obsolete) — Splinter Review
Port iterators to Windows, and depend on bug #422960.
Attachment #319055 - Attachment is obsolete: true
Depends on: 422960
Attached patch Use rb.h instead of tree.h (v3) (obsolete) — Splinter Review
Add missing typedef for Windows.
Attachment #319848 - Attachment is obsolete: true
Attachment #324474 - Flags: review?(benjamin)
Add #endif that was accidentally dropped during a merge.
Attachment #324474 - Attachment is obsolete: true
Attachment #324487 - Flags: review?(benjamin)
Attachment #324474 - Flags: review?(benjamin)
Attachment #324487 - Flags: review?(benjamin) → review+
Attached patch Fix Linux buildSplinter Review
This patch removes some gcc compiler flags that apparently are not supported in older compilers.  I have tested on Ubuntu 8.04 (gcc 4.2.3) and it appears that these flags are no longer necessary anyway.
Attachment #326020 - Flags: review?(ted.mielczarek)
Attachment #326020 - Flags: review?(ted.mielczarek) → review+
changeset:   15460:2f7b7ff816e3
user:        Jason Evans <jasone@canonware.com>
date:        Fri Jun 20 10:34:42 2008 -0700
summary:     Bug 431735: Use rb.h instead of tree.h, r=benjamin

changeset:   15463:dcca5d90ed43
user:        Jason Evans <jasone@canonware.com>
date:        Fri Jun 20 12:00:29 2008 -0700
summary:     Bug 431735: Fix build failures due to compiler flag incompatibilities, r=ted
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: